# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
841995 | 2023-09-02T09:57:33 Z | LucaIlie | Packing Biscuits (IOI20_biscuits) | C++17 | 1000 ms | 436 KB |
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; vector <long long> biscuits; long long solutions; void countSolutions( int b, long long s, long long x ) { solutions++; for ( int i = b + 1; i < biscuits.size(); i++ ) { s /= 2; s += biscuits[i]; if ( s >= x ) countSolutions( i, s - x, x ); } } long long count_tastiness( long long x, vector <long long> a ) { const int k = 60; long long s; a.resize( k ); biscuits.clear(); s = 0; for ( int b = 0; b < k; b++ ) { a[b] += s; if ( a[b] > x ) { s = a[b] - x; a[b] = x + s % 2; s /= 2; } else s = 0; biscuits.push_back( a[b] ); } solutions = 0; countSolutions( -1, 0, x ); return solutions; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 11 ms | 432 KB | Output is correct |
5 | Correct | 3 ms | 348 KB | Output is correct |
6 | Correct | 26 ms | 404 KB | Output is correct |
7 | Correct | 2 ms | 348 KB | Output is correct |
8 | Correct | 26 ms | 348 KB | Output is correct |
9 | Correct | 4 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Correct | 10 ms | 436 KB | Output is correct |
13 | Correct | 5 ms | 348 KB | Output is correct |
14 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 348 KB | Output is correct |
2 | Execution timed out | 1093 ms | 348 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1050 ms | 348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1057 ms | 348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 11 ms | 432 KB | Output is correct |
5 | Correct | 3 ms | 348 KB | Output is correct |
6 | Correct | 26 ms | 404 KB | Output is correct |
7 | Correct | 2 ms | 348 KB | Output is correct |
8 | Correct | 26 ms | 348 KB | Output is correct |
9 | Correct | 4 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Correct | 10 ms | 436 KB | Output is correct |
13 | Correct | 5 ms | 348 KB | Output is correct |
14 | Correct | 1 ms | 348 KB | Output is correct |
15 | Correct | 6 ms | 348 KB | Output is correct |
16 | Execution timed out | 1093 ms | 348 KB | Time limit exceeded |
17 | Halted | 0 ms | 0 KB | - |