이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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.
}
}
컴파일 시 표준 에러 (stderr) 메시지
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;
| ^~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |