# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
405860 | 2021-05-17T00:39:25 Z | ly20 | Packing Biscuits (IOI20_biscuits) | C++17 | 1000 ms | 123456 KB |
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 63; long long mc[MAXN]; bool inf(long long a, long long b) { if(log10(a) + log10(b) > 18) return true; return false; } long long count_tastiness(long long x, vector<long long> a) { int tot = 0; for(int i = 0; i < a.size(); i++) { mc[i] = a[i]; } for(int i = a.size(); i < MAXN; i++) mc[i] = 0; set <long long> s; long long cur = 0; s.insert(0); for(int i = 0; i < MAXN; i++) { int at = mc[i] * (1LL << i); cur += at; if(inf(x, (1LL << i))) continue; long long nec = x * (1LL << i); set <long long> :: iterator it = s.lower_bound(nec - cur); vector <long long> rs; while(it != s.end()) { rs.push_back(*it); it++; } for(int j = 0; j < rs.size(); j++) { s.insert(rs[j] - nec); } } return s.size(); } /* int main() { int t; scanf("%d", &t); while(t--) { long long x; int k; vector <long long> a; scanf("%d %lld", &k, &x); for(int i = 0; i < k; i++) { long long b; scanf("%lld", &b); a.push_back(b); } printf("resp == %lld\n", count_tastiness(x, a)); } return 0; } */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 5056 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 36 ms | 2616 KB | Output is correct |
5 | Correct | 8 ms | 844 KB | Output is correct |
6 | Correct | 103 ms | 5196 KB | Output is correct |
7 | Correct | 5 ms | 588 KB | Output is correct |
8 | Correct | 106 ms | 5312 KB | Output is correct |
9 | Correct | 12 ms | 1084 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 204 KB | Output is correct |
12 | Correct | 28 ms | 1192 KB | Output is correct |
13 | Correct | 14 ms | 704 KB | Output is correct |
14 | Correct | 2 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 5140 KB | Output is correct |
2 | Execution timed out | 1094 ms | 123456 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 972 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 39 ms | 696 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 5056 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 36 ms | 2616 KB | Output is correct |
5 | Correct | 8 ms | 844 KB | Output is correct |
6 | Correct | 103 ms | 5196 KB | Output is correct |
7 | Correct | 5 ms | 588 KB | Output is correct |
8 | Correct | 106 ms | 5312 KB | Output is correct |
9 | Correct | 12 ms | 1084 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 204 KB | Output is correct |
12 | Correct | 28 ms | 1192 KB | Output is correct |
13 | Correct | 14 ms | 704 KB | Output is correct |
14 | Correct | 2 ms | 204 KB | Output is correct |
15 | Correct | 27 ms | 5140 KB | Output is correct |
16 | Execution timed out | 1094 ms | 123456 KB | Time limit exceeded |
17 | Halted | 0 ms | 0 KB | - |