#include <bits/stdc++.h>
#include "koala.h"
using namespace std;
#define endl "\n"
#define ll long long
#define fi first
#define se second
#define pb push_back
int b[100], r[100];
int minValue(int n, int w) {
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) {
memset(b, 1, sizeof(b));
//1
playRound(b, r); //->50
memset(b, 0, sizeof(b));
for (int i = 0; i < n; ++i) {
if(r[i]==2){
b[i]=2;
}
}
//2
playRound(b, r); //->25
memset(b, 0, sizeof(b));
for (int i = 0; i < n; ++i) {
if(r[i]==3){
b[i]=4;
}
}
//3
playRound(b, r); //->9
memset(b, 0, sizeof(b));
for (int i = 0; i < n; ++i) {
if(r[i]==5){
b[i]=11;
}
}
//4
playRound(b, r); //->1
for (int i = 0; i < n; ++i) {
if(r[i]==12){
return i;
}
}
}
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 | }
| ^
koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:67:1: warning: control reaches end of non-void function [-Wreturn-type]
67 | }
| ^
# | 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... |