Submission #108352

# Submission time Handle Problem Language Result Execution time Memory
108352 2019-04-28T17:31:00 Z RezwanArefin01 Koala Game (APIO17_koala) C++17
4 / 100
57 ms 512 KB
#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 = 2, hi = 8;
    while(lo <= hi) {
        int mid = lo + hi >> 1; 
        p[0] = p[1] = min(W / 2, mid); 
        playRound(p, q); 
        if(q[0] && !q[1]) return 0; 
        if(q[1] && !q[0]) return 1; 
        if(!q[0] && !q[1]) hi = mid - 1; 
        else lo = mid + 1; 
    } return -1; 
}

void allValues(int N, int W, int *P) {
    if (W == 2*N) {
    } else {
    }
}

Compilation message

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 time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 7 ms 512 KB Output is correct
4 Correct 6 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 57 ms 384 KB Output is correct
2 Incorrect 3 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -