#include "koala.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
#define PB push_back
#define MP make_pair
#define all(a) (a).begin(), (a).end()
#define endl '\n'
#define dbg(x) cerr << '[' << #x << ": " << x << "]\n"
#define dbg2(x, y) cerr << '[' << #x << ": " << x << ", " << #y << ": " << y << "]\n"
#define YES cout << "YES\n"
#define NO cout << "NO\n"
const ll INF = (ll)2e18 + 1386;
const ld EPS = 0.000000000000001;
const int MOD = 1e9 + 7;
inline int _add(int a, int b){ int res = a + b; return (res >= MOD ? res - MOD : res); }
inline int _neg(int a, int b){ int res = (abs(a - b) < MOD ? a - b : (a - b) % MOD); return (res < 0 ? res + MOD : res); }
inline int _mlt(ll a, ll b){ return (a * b % MOD); }
inline void fileIO(string i, string o){ freopen(i.c_str(), "r", stdin); freopen(o.c_str(), "w", stdout); }
const int MAXN = 103;
int a[MAXN], b[MAXN];
int minValue(int n, int w) {
fill(a, a + n, 0);
a[0] = 1;
playRound(a, b);
if (b[0] == 1) return 0;
for (int i = 0; i < n; i++){
if (b[i] == 0) return i;
}
return -1;
}
int maxValue(int n, int w) {
VI cand, nxt;
bitset<MAXN> incand;
incand.reset();
fill(a, a + n, 1);
playRound(a, b);
for (int i = 0; i < n; i++){
if (b[i] > a[i]){
cand.PB(i);
incand[i] = 1;
}
}
fill(a, a + n, 0);
for (int i : cand) a[i] = 2;
playRound(a, b);
for (int i : cand){
if (b[i] > a[i]) nxt.PB(i);
else incand[i] = 0;
}
cand = nxt; nxt.clear();
fill(a, a + n, 0);
for (int i : cand) a[i] = 4;
playRound(a, b);
for (int i : cand){
if (b[i] > a[i]) nxt.PB(i);
else incand[i] = 0;
}
cand = nxt; nxt.clear();
fill(a, a + n, 0);
for (int i : cand) a[i] = 5;
playRound(a, b);
for (int i : cand){
if (b[i] > a[i]) nxt.PB(i);
else incand[i] = 0;
}
cand = nxt; nxt.clear();
/*fill(a, a + n, 0);
int cnt = 2;
for (int i = 0; i < n; i++){
if (!incand[i] && cnt){
incand[i] = 1, cnt--;
cand.PB(i);
}
}
for (int i : cand) a[i] = 11;
playRound(a, b);
for (int i : cand){
if (b[i] > a[i]) nxt.PB(i);
else incand[i] = 0;
}
cand = nxt; nxt.clear();*/
fill(a, a + n, 0);
/*cnt = 5;
for (int i = 0; i < n; i++){
if (!incand[i] && cnt){
incand[i] = 1, cnt--;
cand.PB(i);
}
}*/
for (int i : cand) a[i] = 14;
playRound(a, b);
for (int i : cand){
if (b[i] > a[i]) nxt.PB(i);
else incand[i] = 0;
}
cand = nxt; nxt.clear();
return cand[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.
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
344 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
14 ms |
344 KB |
Output is partially correct |
2 |
Partially correct |
12 ms |
344 KB |
Output is partially correct |
3 |
Partially correct |
12 ms |
456 KB |
Output is partially correct |
4 |
Partially correct |
12 ms |
456 KB |
Output is partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |