#include <bits/stdc++.h>
#include "koala.h"
using namespace std;
int p[100], q[100];
int minValue(int N, int W) {
p[0] = 1;
playRound(p, q);
for(int i = 0; i < N; ++i)
if(!q[i]) return i;
return -1;
}
int maxValue(int N, int W) {
return -1;
}
int greaterValue(int N, int W) {
int lo = 1, hi = min(W / 2, 8);
while(lo <= hi) {
int mid = lo + hi >> 1;
p[0] = p[1] = mid;
playRound(p, q);
bool z = q[0] > p[0];
bool o = q[1] > p[1];
if(z == o) {
if(z) lo = mid + 1;
else hi = mid - 1;
} else {
return z ? 0 : 1;
}
} return -1;
}
void allValues(int N, int W, int *P) {
if (W == 2*N) {
} else {
}
}
Compilation message
koala.cpp: In function 'int greaterValue(int, int)':
koala.cpp:23:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = lo + hi >> 1;
~~~^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
75 ms |
548 KB |
Output is partially correct |
2 |
Partially correct |
77 ms |
384 KB |
Output is partially correct |
3 |
Partially correct |
75 ms |
512 KB |
Output is partially correct |
4 |
Partially correct |
64 ms |
384 KB |
Output is partially correct |
5 |
Partially correct |
69 ms |
384 KB |
Output is partially correct |
6 |
Partially correct |
73 ms |
560 KB |
Output is partially correct |
7 |
Partially correct |
70 ms |
384 KB |
Output is partially correct |
8 |
Partially correct |
76 ms |
504 KB |
Output is partially correct |
9 |
Partially correct |
67 ms |
384 KB |
Output is partially correct |
10 |
Partially correct |
69 ms |
384 KB |
Output is partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |