이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int N = 105;
int n, w;
int p[105];
int maxQueries = 3200, numQueries;
void playRound(int *B, int *R);
int tmp1[105], tmp2[105];
vector<int> get(vector<int> a) {
copy(a.begin(), a.end(), tmp1);
playRound(tmp1, tmp2);
copy(tmp2, tmp2 + a.size(), a.begin());
return a;
}
int minValue(int n, int w) {
vector<int> a(n, 0);
++a[0];
a = get(a);
--a[0];
for (int i = 0; i < n; ++i)
if (a[i] <= 0) return i;
}
int maxValue(int n, int w) {
// TODO: Implement Subtask 2 solution here.
// You may leave this function unmodified if you are not attempting this
// subtask.
return 0;
}
int greaterValue(int n, int w) {
// TODO: Implement Subtask 3 solution here.
// You may leave this function unmodified if you are not attempting this
// subtask.
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.
}
}
/** /\_/\
* (= ._.)
* / >0 \>1
**/
컴파일 시 표준 에러 (stderr) 메시지
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:24:23: warning: control reaches end of non-void function [-Wreturn-type]
24 | vector<int> a(n, 0);
| ^| # | 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... |