#include "biscuits.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rmin(r, x) r = min(r, x)
#define rmax(r, x) r = max(r, x)
#define ends ' '
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxk = 65;
int k;
ll s[maxk];
long long count_tastiness(long long x, std::vector<long long> a) {
k = a.size();
a.resize(maxk);
s[0] = a[0];
for(int i = 1; i <= 60; ++i) s[i] = s[i - 1] + (1LL << i) * a[i];
vector<ll> ans;
ans.eb(0);
for(int i = 0; i <= 60; ++i) {
vector<ll> t;
for(auto y : ans) {
y += (1LL << i);
if(s[i] / x >= y) t.eb(y);
else break;
}
ans.insert(ans.end(), all(t));
}
assert(ans.size() <= 2e5);
return ans.size();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
2164 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
1404 KB |
Output is correct |
5 |
Correct |
1 ms |
628 KB |
Output is correct |
6 |
Correct |
9 ms |
2964 KB |
Output is correct |
7 |
Correct |
1 ms |
504 KB |
Output is correct |
8 |
Correct |
9 ms |
2964 KB |
Output is correct |
9 |
Correct |
1 ms |
648 KB |
Output is correct |
10 |
Correct |
1 ms |
256 KB |
Output is correct |
11 |
Correct |
0 ms |
256 KB |
Output is correct |
12 |
Correct |
4 ms |
832 KB |
Output is correct |
13 |
Correct |
2 ms |
560 KB |
Output is correct |
14 |
Correct |
1 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
2164 KB |
Output is correct |
2 |
Runtime error |
61 ms |
27952 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1076 ms |
525820 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1084 ms |
5652 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
2164 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
1404 KB |
Output is correct |
5 |
Correct |
1 ms |
628 KB |
Output is correct |
6 |
Correct |
9 ms |
2964 KB |
Output is correct |
7 |
Correct |
1 ms |
504 KB |
Output is correct |
8 |
Correct |
9 ms |
2964 KB |
Output is correct |
9 |
Correct |
1 ms |
648 KB |
Output is correct |
10 |
Correct |
1 ms |
256 KB |
Output is correct |
11 |
Correct |
0 ms |
256 KB |
Output is correct |
12 |
Correct |
4 ms |
832 KB |
Output is correct |
13 |
Correct |
2 ms |
560 KB |
Output is correct |
14 |
Correct |
1 ms |
384 KB |
Output is correct |
15 |
Correct |
3 ms |
2164 KB |
Output is correct |
16 |
Runtime error |
61 ms |
27952 KB |
Execution killed with signal 11 |
17 |
Halted |
0 ms |
0 KB |
- |