#include "koala.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll i;
int minValue(int N, int W) {
int a[110],b[110];
for(i=0;i<N;i++)
a[i]=0;
a[0]=1;
playRound(a,b);
for(i=0;i<N;i++)
if(b[i]==0)
return i;
return 0;
}
int maxValue(int N, int W) {
ll VS,K;
int a[110],b[110];
vector<ll> v;
for(i=0;i<N;i++)
v.pb(i);
VS=N;
K=1;
while(VS>1)
{
vector<ll> vv;
for(i=0;i<N;i++)
a[i]=0;
K=W/VS;
for(i=0;i<VS;i++)
a[v[i]]=K;
playRound(a,b);
for(i=0;i<N;i++)
if(b[i]>K)
vv.pb(i);
v=vv;
VS=v.size();
}
return v[0];
}
ll L,R,C;
int greaterValue(int N, int W) {
int a[110],b[110];
for(i=0;i<N;i++)
a[i]=0;
L=1;
R=min(14,N/2);
while(L<=R)
{
C=(L+R)/2;
a[0]=C;
a[1]=C;
playRound(a,b);
//cout<<i<<" "<<b[0]<<" "<<b[1]<<"\n";
if(b[0]>b[1])return 0;
if(b[0]<b[1])return 1;
if(b[0]>C)L=C+1;
else R=C-1;
}
return 0;
}
void allValues(int N, int W, int *P) {
if (W == 2*N) {
ll VS,K;
int a[110],b[110],sud[110];
for(i=0;i<N;i++)
sud[i]=0;
ll j;
for(j=N-1;j>=0;j--)
{
vector<ll> v;
for(i=0;i<N;i++)
if(!sud[i])
v.pb(i);
VS=j+1;
K=2;
while(VS>1)
{
vector<ll> vv;
for(i=0;i<N;i++)
a[i]=0;
K=W/(VS);
for(i=0;i<VS;i++)
a[v[i]]=K;
//cout<<j<<" "<<VS<<" "<<K<<"\n";
playRound(a,b);
for(i=0;i<N;i++)
if(b[i]>K&&a[i]==K)
vv.pb(i);
v=vv;
VS=v.size();
}
sud[v[0]]=1;
// cout<<v[0]<<"\n";
P[v[0]]=j+1;
}
} else {
// TODO: Implement Subtask 5 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
376 KB |
Output is correct |
2 |
Correct |
6 ms |
468 KB |
Output is correct |
3 |
Correct |
9 ms |
468 KB |
Output is correct |
4 |
Correct |
7 ms |
564 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
564 KB |
Output is correct |
2 |
Correct |
20 ms |
564 KB |
Output is correct |
3 |
Correct |
17 ms |
784 KB |
Output is correct |
4 |
Correct |
17 ms |
800 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
52 ms |
800 KB |
Output is correct |
2 |
Correct |
69 ms |
800 KB |
Output is correct |
3 |
Correct |
53 ms |
840 KB |
Output is correct |
4 |
Correct |
54 ms |
840 KB |
Output is correct |
5 |
Correct |
74 ms |
840 KB |
Output is correct |
6 |
Correct |
61 ms |
840 KB |
Output is correct |
7 |
Correct |
55 ms |
840 KB |
Output is correct |
8 |
Correct |
55 ms |
840 KB |
Output is correct |
9 |
Correct |
54 ms |
840 KB |
Output is correct |
10 |
Correct |
54 ms |
840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
840 KB |
Output is correct |
2 |
Correct |
41 ms |
840 KB |
Output is correct |
3 |
Correct |
42 ms |
840 KB |
Output is correct |
4 |
Correct |
41 ms |
840 KB |
Output is correct |
5 |
Correct |
42 ms |
840 KB |
Output is correct |
6 |
Correct |
42 ms |
936 KB |
Output is correct |
7 |
Correct |
38 ms |
936 KB |
Output is correct |
8 |
Correct |
38 ms |
936 KB |
Output is correct |
9 |
Correct |
40 ms |
936 KB |
Output is correct |
10 |
Correct |
39 ms |
936 KB |
Output is correct |
11 |
Correct |
51 ms |
936 KB |
Output is correct |
12 |
Correct |
41 ms |
936 KB |
Output is correct |
13 |
Correct |
41 ms |
968 KB |
Output is correct |
14 |
Correct |
42 ms |
968 KB |
Output is correct |
15 |
Correct |
40 ms |
968 KB |
Output is correct |
16 |
Correct |
41 ms |
968 KB |
Output is correct |
17 |
Correct |
38 ms |
968 KB |
Output is correct |
18 |
Correct |
43 ms |
968 KB |
Output is correct |
19 |
Correct |
45 ms |
968 KB |
Output is correct |
20 |
Correct |
40 ms |
968 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
968 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |