#include "biscuits.h"
#include <bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define mkp make_pair
#define in insert
#define er erase
#define fd find
#define fr first
#define sc second
#define all(x) x.begin(),x.end()
#define lun(x) (int)x.size()
typedef long long ll;
typedef long double ld;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll llinf=(1LL<<60);
const int inf=(1<<30);
const int nmax=1e5+50;
const ll mod=1e9+7;
using namespace std;
int i,rs,j,t,bl;
ll y,s,m;
vector<ll>b;
ll count_tastiness(ll x,vector<ll> a)
{
s=0;
for(i=0;i<lun(a);i++)s+=(1LL<<i)*a[i];
rs=1;
for(i=1;i<=s/x;i++)
{
bl=1;
b=a;
for(j=1;j<=x;j++)
{
y=i;
for(t=lun(b)-1;t>=0;t--)
{
if(y-b[t]*(1LL<<t)>=0)
{
y-=b[t]*(1LL<<t);
b[t]=0;
}
else
{
m=y/(1LL<<t);
b[t]-=m;
y-=m*(1LL<<t);
}
}
if(y)
{
bl=0;
break;
}
}
rs+=bl;
}
return rs;
}
/*int main()
{
//freopen("sol.in","r",stdin);
//freopen("sol.out","w",stdout);
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
return 0;
}*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
14 ms |
492 KB |
Output is correct |
5 |
Correct |
3 ms |
364 KB |
Output is correct |
6 |
Correct |
65 ms |
364 KB |
Output is correct |
7 |
Correct |
2 ms |
364 KB |
Output is correct |
8 |
Correct |
69 ms |
492 KB |
Output is correct |
9 |
Correct |
3 ms |
364 KB |
Output is correct |
10 |
Correct |
8 ms |
364 KB |
Output is correct |
11 |
Correct |
2 ms |
364 KB |
Output is correct |
12 |
Correct |
171 ms |
364 KB |
Output is correct |
13 |
Correct |
152 ms |
492 KB |
Output is correct |
14 |
Correct |
146 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
364 KB |
Output is correct |
2 |
Execution timed out |
1086 ms |
364 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1050 ms |
492 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1076 ms |
364 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
14 ms |
492 KB |
Output is correct |
5 |
Correct |
3 ms |
364 KB |
Output is correct |
6 |
Correct |
65 ms |
364 KB |
Output is correct |
7 |
Correct |
2 ms |
364 KB |
Output is correct |
8 |
Correct |
69 ms |
492 KB |
Output is correct |
9 |
Correct |
3 ms |
364 KB |
Output is correct |
10 |
Correct |
8 ms |
364 KB |
Output is correct |
11 |
Correct |
2 ms |
364 KB |
Output is correct |
12 |
Correct |
171 ms |
364 KB |
Output is correct |
13 |
Correct |
152 ms |
492 KB |
Output is correct |
14 |
Correct |
146 ms |
376 KB |
Output is correct |
15 |
Correct |
6 ms |
364 KB |
Output is correct |
16 |
Execution timed out |
1086 ms |
364 KB |
Time limit exceeded |
17 |
Halted |
0 ms |
0 KB |
- |