Submission #1361753

#TimeUsernameProblemLanguageResultExecution timeMemory
1361753jumpKoala Game (APIO17_koala)C++20
4 / 100
2 ms412 KiB
#include "koala.h"
#include <bits/stdc++.h>
int parr[110];
int res[110];
int NG,NW;
void play(){
    // std::cout << "in";
    // for(int i=0;i<NG;i++)std::cout << parr[i] << ' ';
    // std::cout << '\n';
    playRound(parr,res);
    // std::cout << "out";
    // for(int i=0;i<NW;i++)std::cout << res[i] << ' ';
    // std::cout << '\n';
}
int minValue(int N, int W) {
    NG=N,NW=W;
    // TODO: Implement Subtask 1 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    parr[0]=1;
    play();
    if(res[0]<2)return 0;
    for(int i=1;i<N;i++){
        if(res[i]==0)return i;
    }
    return 0;
}
/*
1 1   
10 10
2 1 3 4 5 6 7 8 9 10
*/
/*
1 1   
10 10
10 3 2 4 5 6 7 8 9 1
*/
int maxValue(int N, int W) {
    NG=N,NW=W;
    bool notans[105];
    // TODO: Implement Subtask 2 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    int cnt=N;
    while(cnt>1){
        //std::cout << cnt << ' ';
        for(int i=0;i<N;i++){
            if(notans[i])parr[i]=0;
            else parr[i]=std::min(14,W/cnt);
        }
        play();
        for(int i=0;i<N;i++){
            if(notans[i])continue;
            if(parr[i]>=res[i])cnt-=1,notans[i]=true;
        }
    }
    for(int i=0;i<N;i++)if(!notans[i])return i;
    return 0;
}
/*
2 1   
10 10
10 3 2 4 5 6 7 8 9 1
*/

int greaterValue(int N, int W) {
    // TODO: Implement Subtask 3 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    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.
    }
}
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...