#include "koala.h"
#include <bits/stdc++.h>
#include <ostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX_N = 100;
int B[MAX_N], R[MAX_N];
int minValue(int N, int W) {
// TODO: Implement Subtask 1 solution here.
// You may leave this function unmodified if you are not attempting this
// subtask.
memset(B, 0, sizeof B);
B[0] = 1;
playRound(B, R);
int zero_pos = find(R, R+N, 0) - R;
return zero_pos;
}
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.
for (int i=0; i<N; ++i) B[i] = 1;
playRound(B, R);
vector<int> half_large;
for (int i=0; i<N; ++i) {
if (R[i] == 2) half_large.push_back(i);
}
assert(half_large.size() == 50);
memset(B, 0, sizeof B);
for (int i: half_large) B[i] = 2;
playRound(B, R);
vector<int> quarter_large;
for (int i=0; i<N; ++i) {
if (R[i] == 3) quarter_large.push_back(i);
}
memset(B, 0, sizeof B);
for (int i: quarter_large) B[i] = 4;
playRound(B, R);
vector<int> ninetyone_large;
for (int i=0; i<N; ++i) {
if (R[i] > 1) ninetyone_large.push_back(i);
}
memset(B, 0, sizeof B);
for (int i: ninetyone_large) B[i] = 11;
playRound(B, R);
return find(R, R+N, 12) - R;
}
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.
for (int i=1; i<=14; ++i) {
memset(B, 0, sizeof B);
B[0] = B[1] = i;
playRound(B, R);
if (R[0] != R[1]) return R[0] < R[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.
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
208 KB |
Output is correct |
2 |
Correct |
3 ms |
208 KB |
Output is correct |
3 |
Correct |
4 ms |
320 KB |
Output is correct |
4 |
Correct |
4 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
208 KB |
Output is correct |
2 |
Correct |
11 ms |
208 KB |
Output is correct |
3 |
Correct |
15 ms |
320 KB |
Output is correct |
4 |
Correct |
12 ms |
324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
135 ms |
320 KB |
Output is partially correct |
2 |
Partially correct |
150 ms |
328 KB |
Output is partially correct |
3 |
Partially correct |
147 ms |
324 KB |
Output is partially correct |
4 |
Partially correct |
133 ms |
336 KB |
Output is partially correct |
5 |
Partially correct |
137 ms |
448 KB |
Output is partially correct |
6 |
Partially correct |
138 ms |
320 KB |
Output is partially correct |
7 |
Partially correct |
132 ms |
324 KB |
Output is partially correct |
8 |
Partially correct |
142 ms |
328 KB |
Output is partially correct |
9 |
Partially correct |
143 ms |
432 KB |
Output is partially correct |
10 |
Partially correct |
161 ms |
316 KB |
Output is partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |