Submission #108359

#TimeUsernameProblemLanguageResultExecution timeMemory
108359RezwanArefin01Koala Game (APIO17_koala)C++17
22 / 100
76 ms504 KiB
#include <bits/stdc++.h> #include "koala.h" using namespace std; int p[100], q[100]; int minValue(int N, int W) { p[0] = 1; playRound(p, q); for(int i = 0; i < N; ++i) if(!q[i]) return i; return -1; } int maxValue(int N, int W) { return -1; } int greaterValue(int N, int W) { int lo = 1, hi = min(W / 2, 9); while(lo <= hi) { int mid = lo + hi >> 1; p[0] = p[1] = mid; playRound(p, q); bool z = q[0] > p[0]; bool o = q[1] > p[1]; if(z == o) { if(z) lo = mid + 1; else hi = mid - 1; } else { return z ? 0 : 1; } } return -1; } void allValues(int N, int W, int *P) { if (W == 2*N) { } else { } }

Compilation message (stderr)

koala.cpp: In function 'int greaterValue(int, int)':
koala.cpp:23:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
         int mid = lo + hi >> 1; 
                   ~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...