#include "koala.h"
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define repa(i,a,b) for(int i = (a); i >= (b); i--)
#define pll pair<lli,lli>
int b[100],r[100];
lli res;
int minValue(int n, int w) {
b[0] = 1;
playRound(b,r);
res = 0;
rep(i,1,n-1) {
if (r[i] == 0) {
res = i;
break;
}
}
return res;
}
int maxValue(int n, int w) { //binaria pero aun no se muy bien como
lli a,lim;
rep(i,1,15) {
a = i*(i+1)/2;
if (a > n) lim = i-1;
}
return 0;
}
int greaterValue(int n, int w) {
lli ini = 1;
lli mitad,fin = 20;
while (ini <= fin) {
mitad = (ini+fin)/2;
b[0] = mitad;
b[1] = mitad;
playRound(b,r);
if(r[0]>mitad && r[1]>mitad) ini = mitad+1;
else if(r[0] <= mitad && r[1] <= mitad) fin = mitad-1;
else {
if (r[0] > r[1]) return 0;
else return 1;
}
}
return 0;
}
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.
}
}
Compilation message
koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:31:11: warning: variable 'lim' set but not used [-Wunused-but-set-variable]
31 | lli a,lim;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
4 ms |
208 KB |
Output is correct |
3 |
Correct |
3 ms |
208 KB |
Output is correct |
4 |
Correct |
4 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
324 KB |
Output is correct |
2 |
Partially correct |
46 ms |
332 KB |
Output is partially correct |
3 |
Correct |
44 ms |
332 KB |
Output is correct |
4 |
Correct |
41 ms |
328 KB |
Output is correct |
5 |
Partially correct |
42 ms |
336 KB |
Output is partially correct |
6 |
Correct |
40 ms |
336 KB |
Output is correct |
7 |
Partially correct |
41 ms |
332 KB |
Output is partially correct |
8 |
Correct |
42 ms |
328 KB |
Output is correct |
9 |
Correct |
39 ms |
336 KB |
Output is correct |
10 |
Correct |
44 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |