首页 > TAG信息列表 > presents
【题解】CF1279C Stack of Presents
Sol 考虑每次读进一个 \(b_i\),就从 \(a\) 数组中统计出答案。 每次对于一个 \(b_i\),可以将 \(a\) 数组中对应位置的前缀丢到一个 \(vis\) 里。 若后面读进的 \(b_i\) 的 \(vis\) 值为 \(1\),那么他对于答案没有贡献。 因为题目中保证了各个数不唯一,所以这个做法一定是正确的。 CodeCodeforces 1236B. Alice and the List of Presents
传送门 显然每种礼物是互相独立的,一个礼物的分配不会影响另一个礼物 对于某个礼物 $x$ , 对于每个盒子来说,要么选要么不选,那么可以看成长度为 $m$ 的二进制序列 这个序列第 $i$ 位的数就代表第 $i$ 个盒子里是否有这个礼物,那么总方案即为 $2^m-1$ ,减 $1$ 是因为全 $0$ 的序列是不合Codeforces 1090C New Year Presents
New Year Presents 用set模拟一下。。 写的bug有点多。 #include<bits/stdc++.h>#define LL long long#define fi first#define se second#define mk make_pair#define PII pair<int, int>using namespace std;const int N = (int)1e5 + 7;int n, m, sum, min_cnt, tar[N], nu【背包问题】PACKING
题目描述 It was bound to happen. Modernisation has reached the North Pole. Faced with escalating costs for feeding Santa Claus and the reindeer, and serious difficulties with security, NP Management has decided to do away with the traditional sleigh and a刷题日记----136A - Presents
A. Presents time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Little Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother. He immediately decided t