답안 #108351

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
108351 2019-04-28T17:29:39 Z RezwanArefin01 코알라 (APIO17_koala) C++17
18 / 100
78 ms 760 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 = 1, 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; 
                   ~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 384 KB Output is correct
2 Correct 7 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 61 ms 420 KB Output is partially correct
2 Partially correct 78 ms 408 KB Output is partially correct
3 Partially correct 67 ms 632 KB Output is partially correct
4 Partially correct 68 ms 760 KB Output is partially correct
5 Partially correct 60 ms 760 KB Output is partially correct
6 Partially correct 60 ms 640 KB Output is partially correct
7 Partially correct 60 ms 640 KB Output is partially correct
8 Partially correct 63 ms 684 KB Output is partially correct
9 Partially correct 59 ms 628 KB Output is partially correct
10 Partially correct 67 ms 640 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -