이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "koala.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e2 + 20;
int b[maxn] , r[maxn];
bool can[maxn];
int minValue(int n, int w)
{
memset(b , 0 , sizeof b);
b[0] = 1;
playRound(b , r);
if(r[0] != 2)
return 0;
for(int i = 1; i < n - 1; i++)
if(!r[i])
return i;
}
int maxValue(int n, int w)
{
for(int i = 0; i < n; i++)
can[i] = 1;
int rem = n;
while(rem > 1)
{
for(int i = 0; i < n; i++)
{
if(can[i])
b[i] = w / rem;
else
b[i] = 0;
}
playRound(b , r);
for(int i = 0; i < n; i++)
if(can[i] && r[i] <= b[i])
can[i] = 0 , rem--;
}
for(int i = 0; i < n; i++)
if(can[i])
return i;
}
int greaterValue(int n, int w)
{
// p[0] < p[1]?
memset(b , 0 , sizeof b);
b[0] = b[1] = 1;
playRound(b , r);
if(r[0] > b[0])
return 0;
else
return 1;
return 0;
}
void allValues(int N, int W, int *P)
{
if (W == 2*N)
{
}
else
{
}
}
컴파일 시 표준 에러 (stderr) 메시지
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:53:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | 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... |