Submission #1089819

# Submission time Handle Problem Language Result Execution time Memory
1089819 2024-09-17T08:26:41 Z alexander707070 Koala Game (APIO17_koala) C++14
18 / 100
74 ms 460 KB
#include<bits/stdc++.h>
#define MAXN 107
#include "koala.h"

using namespace std;

int b[MAXN],r[MAXN];

int minValue(int N, int W) {
    b[0]=1;
    playRound(b,r);

    for(int i=0;i<N;i++){
        if(r[i]==0)return i;
    }
    return 0;
}

vector<int> can,best;

void reset(){
    best.clear(); can.clear();
    for(int i=0;i<100;i++)b[i]=0;
}

int maxValue(int N, int W) {
    reset();

    for(int i=0;i<50;i++){
        b[i]=2;
    }
    playRound(b,r);
    
    for(int i=0;i<50;i++){
        if(r[i]>=3)can.push_back(i);
    }

    for(int i=0;i<100;i++){
        if(i<50)b[i]=0;
        else b[i]=2;
    }
    playRound(b,r);
    
    for(int i=50;i<100;i++){
        if(r[i]>=3)can.push_back(i);
    }

    for(int i=0;i<100;i++)b[i]=0;
    cout<<can.size()<<":\n";
    for(int i:can)b[i]=3;

    playRound(b,r);

    for(int i:can){
        if(r[i]>=4)best.push_back(i);
    }

    for(int i=0;i<100;i++)b[i]=0;
    for(int i:best)b[i]=7;

    playRound(b,r);

    for(int i:best){
        if(r[i]>=8)return i;
    }
}

int greaterValue(int N, int W) {
    int ll=0,rr=10,tt;
    while(ll+1<rr){
        tt=(ll+rr)/2;

        b[0]=b[1]=tt;
        playRound(b,r);

        if(r[0]<tt and r[1]<tt){
            rr=tt;
        }else if(r[0]>=tt and r[0]>=tt){
            ll=tt;
        }else{
            if(r[0]>=tt)return 0;
            else return 1;
        }
    }
    
    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.
    }
}

Compilation message

koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:66:1: warning: control reaches end of non-void function [-Wreturn-type]
   66 | }
      | ^
# 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 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 74 ms 344 KB Output is partially correct
2 Partially correct 66 ms 344 KB Output is partially correct
3 Partially correct 69 ms 456 KB Output is partially correct
4 Partially correct 68 ms 344 KB Output is partially correct
5 Partially correct 71 ms 460 KB Output is partially correct
6 Partially correct 72 ms 344 KB Output is partially correct
7 Partially correct 69 ms 344 KB Output is partially correct
8 Partially correct 73 ms 460 KB Output is partially correct
9 Partially correct 69 ms 340 KB Output is partially correct
10 Partially correct 69 ms 344 KB Output is partially correct
# 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 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -