#include "koala.h"
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define fi first
#define se second
#define pb push_back
int minValue(int n, int w) {
int B[100], R[100];
memset(B, 0, sizeof(B));
B[0] = 1;
playRound(B, R);
if (R[0] <= 1)
return 0;
else {
for (int i = 0; i < n; ++i) {
if (R[i] == 0)
return i;
}
}
}
int maxValue(int n, int w) {
int B[n], R[n];
memset(B, 0, sizeof(B));
int cnt = n, ans = 0;
vector<bool> v(n, 1);
while (cnt > 1) {
playRound(B, R);
cnt = 0;
for (int i = 0; i < n; i++) {
if (!v[i])
continue;
if (R[i] > B[i]) {
cnt++;
ans = i;
}
else {
v[i] = 0;
B[i] = 0;
}
}
for (int i = 0; i < n; ++i) {
if (R[i] > B[i] )
B[i]++;
}
}
return ans;
}
int greaterValue(int n, int w) {
// int B[100], R[100];
// memset(B, 0, sizeof(B));
// B[0] = 1, B[1] = 1;
//
// playRound(B, R);
//
// if (R[0] == 0)
// return 1;
// else
return 0;
}
void allValues(int n, int w, int *p) {
return;
}
Compilation message (stderr)
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
27 | }
| ^
# | 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... |