#include "koala.h"
#include <bits/stdc++.h>
#include "grader.cpp"
using namespace std;
int minValue(int N, int W) {
int x[N], y[N];
for(int i = 0; i < N; i++) x[i]=1;
set<int> S; S.clear();
for(int i = 0; i < N; i++) S.insert(i);
playRound(x,y);
for(int i = 0; i < N; i++)
if(y[i]==2) x[i]=0, S.erase(i);
for(int i = 0; i < N; i++){
if(x[i]) continue;
x[i] = W-accumulate(x,x+N,0); break;
}
playRound(x,y);
for(int i = 0; i < N; i++){
if(!S.count(i)) continue;
if(y[i]>=1) S.erase(i);
}
return *S.begin()+1;
}
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.
}
}
Compilation message
In file included from koala.cpp:3:
grader.cpp: In function 'void runGame(int)':
grader.cpp:133:24: warning: ''target_mem_ref' not supported by dump_expr<expression error>' may be used uninitialized in this function [-Wmaybe-uninitialized]
133 | if (userP[i] != P[i]) {
| ~~~~~~~^
/usr/bin/ld: /tmp/ccvFKE5s.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccjmQfkq.o:koala.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccvFKE5s.o: in function `playRound(int*, int*)':
grader.cpp:(.text+0x280): multiple definition of `playRound(int*, int*)'; /tmp/ccjmQfkq.o:koala.cpp:(.text+0x360): first defined here
collect2: error: ld returned 1 exit status