답안 #75778

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
75778 2018-09-11T05:34:12 Z faustaadp 코알라 (APIO17_koala) C++17
22 / 100
59 ms 2116 KB
#include "koala.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll i;
int minValue(int N, int W) {
    int a[110],b[110];
    for(i=0;i<N;i++)
        a[i]=0;
    a[0]=1;
    playRound(a,b);
    for(i=0;i<N;i++)
        if(b[i]==0)
            return i;
    return 0;
}
vector<ll> v;

int maxValue(int N, int W) {
    ll VS,K;
    int a[110],b[110];
    for(i=0;i<N;i++)
        v.pb(i);
    VS=N;
    K=1;
    while(VS>1)
    {
        vector<ll> vv;
        for(i=0;i<N;i++)
            a[i]=0;
        K=N/VS;
        for(i=0;i<VS;i++)
            a[v[i]]=K;
        playRound(a,b);
        for(i=0;i<N;i++)
            if(b[i]>K)
            {
                if(a[i]!=K)
                    while(1);
                vv.pb(i);
            }
        v=vv;
      //  K++;
        VS=v.size();
        //K++;
        //break;
   //     cout<<VS<<"\n";
    }
    if(VS==0)
        while(1);
    return v[0];
}
ll L,R,C;
int greaterValue(int N, int W) {
    int a[110],b[110];
    for(i=0;i<N;i++)
        a[i]=0;
    L=1;
    R=min(14,N/2);
    while(L<=R)
    {
        C=(L+R)/2;
        a[0]=C;
        a[1]=C;
        playRound(a,b);
        //cout<<i<<" "<<b[0]<<" "<<b[1]<<"\n";
        if(b[0]>b[1])return 0;
        if(b[0]<b[1])return 1;
        if(b[0]>C)L=C+1;
        else   R=C-1;
    }
    return 0;
}

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

    } else {
        // TODO: Implement Subtask 5 solution here.
        // You may leave this block unmodified if you are not attempting this
        // subtask.
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 376 KB Output is correct
2 Correct 8 ms 536 KB Output is correct
3 Correct 6 ms 656 KB Output is correct
4 Correct 7 ms 660 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 908 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 52 ms 1160 KB Output is correct
2 Correct 59 ms 1380 KB Output is correct
3 Correct 50 ms 1800 KB Output is correct
4 Correct 52 ms 2044 KB Output is correct
5 Correct 57 ms 2112 KB Output is correct
6 Correct 52 ms 2112 KB Output is correct
7 Correct 51 ms 2116 KB Output is correct
8 Correct 57 ms 2116 KB Output is correct
9 Correct 59 ms 2116 KB Output is correct
10 Correct 55 ms 2116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2116 KB Output isn't correct
2 Halted 0 ms 0 KB -