# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
462012 | kingfran1907 | Ice Hockey World Championship (CEOI15_bobek) | C++14 | 484 ms | 8636 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long llint;
const int maxn = 2e5+10;
const int base = 31337;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int logo = 18;
const int off = 1 << logo;
const int treesiz = off << 1;
int n;
llint m;
llint niz[maxn];
vector< llint > v;
int main() {
scanf("%d%lld", &n, &m);
for (int i = 0; i < n; i++)
scanf("%lld", niz+i);
int hf = n / 2;
int lim = (1 << hf);
for (int mask = 0; mask < lim; mask++) {
llint sum = 0;
for (int i = 0; i < hf; i++)
if (mask & (1 << i)) sum += niz[i];
v.push_back(sum);
}
sort(v.begin(), v.end());
llint sol = 0;
lim = (1 << (n - hf));
for (int mask = 0; mask < lim; mask++) {
llint sum = 0;
for (int i = 0; i < n - hf; i++) {
if (mask & (1 << i)) sum += niz[i];
}
int ind = upper_bound(v.begin(), v.end(), m - sum) - v.begin();
sol += ind;
}
printf("%lld\n", sol);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |