#include "koala.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#define pb push_back
#define F first
#define S second
#define ld long double
#define all(a) a.begin(),a.end()
#define pii pair <int,int>
#define sz(v) (int)v.size()
#define rep(i , a , b) for(int i=a;i <= (b);i++)
#define per(i , a , b) for(int i=a;i >= (b);i--)
#define deb(x) cout <<#x << " : " << x << "\n" ;
using namespace std ;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 5e5+10 , maxk = 1e4, sq = 1e5 , lg = 19, inf = 1e9+10 , mod = 31607;
int B[maxn] , R[maxn] ;
int minValue(int N, int W) {
int a[N] , b[N] ;
rep(i , 0 , N-2){
a[i] =0 ;
}
a[N-1] = 1;
playRound(a,b) ;
rep(i , 0 , N-2){
if(b[i] == 0)return i ;
}
return N-1 ;
}
int maxValue(int n, int w) {
vector <int> vec;
rep(i , 0 , n-1)vec.pb(i) ;
while(sz(vec)!=1){
int a[n] , b[n] ;
int x =min(13 ,w/sz(vec)) ;
rep(i ,0 ,n-1)a[i] = 0;
rep(i , 0 , sz(vec)-1){
a[vec[i]] = x;
}
playRound(a,b) ;
vec.clear();
rep(i , 0 , n-1)if(a[i] > 0 && b[i] > a[i])vec.pb(i) ;
}
return vec[0];
}
int greaterValue(int n, int W){
for(int x = 1;x < n;x++){
B[0] = x;
B[1] = x;
playRound(B,R);
if(R[0] > R[1]) return 0;
if(R[1] > R[0]) return 1;
}
return -1;
}
void allValues(int N, int W, int *P) {
if (W == 2*N) {
// TODO: Implement Subtask 4 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
} else {
// TODO: Implement Subtask 5 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
344 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
344 KB |
Output is correct |
2 |
Correct |
10 ms |
344 KB |
Output is correct |
3 |
Correct |
11 ms |
344 KB |
Output is correct |
4 |
Correct |
13 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
118 ms |
2532 KB |
Output is partially correct |
2 |
Partially correct |
122 ms |
2528 KB |
Output is partially correct |
3 |
Partially correct |
114 ms |
2524 KB |
Output is partially correct |
4 |
Partially correct |
116 ms |
2528 KB |
Output is partially correct |
5 |
Partially correct |
119 ms |
2528 KB |
Output is partially correct |
6 |
Partially correct |
115 ms |
2524 KB |
Output is partially correct |
7 |
Partially correct |
117 ms |
2528 KB |
Output is partially correct |
8 |
Partially correct |
115 ms |
2532 KB |
Output is partially correct |
9 |
Partially correct |
118 ms |
2532 KB |
Output is partially correct |
10 |
Partially correct |
114 ms |
2528 KB |
Output is partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |