Submission #904309

# Submission time Handle Problem Language Result Execution time Memory
904309 2024-01-12T03:16:30 Z irmuun Koala Game (APIO17_koala) C++17
19 / 100
11 ms 456 KB
#include<bits/stdc++.h>
#include "koala.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

int minValue(int N,int W){
    int B[N],R[N];
    fill(B,B+N,0);
    B[0]=1;
    playRound(B,R);
    int ans=0;
    for(int i=1;i<N;i++){
        if(R[i]==0){
            ans=i;
        }
    }
    return ans;
}
int maxValue(int N,int W){
    int B[N],R[N],ans=-1;
    int V[N];
    fill(V,V+N,0);
    while(true){
        int cur=0;
        for(int i=0;i<N;i++){
            if(V[i]==0){
                ans=i;
                cur++;
            }
        }
        if(cur==1){
            break;
        }
        for(int i=0;i<N;i++){
            if(V[i]==0){
                B[i]=W/cur;
            }
            else{
                B[i]=0;
            }
        }
        playRound(B,R);
        for(int i=0;i<N;i++){
            if(R[i]<=B[i]){
                V[i]=1;
            }
        }
    }
    return ans;
}
int greaterValue(int N,int W){
    return 0;
}
void allValues(int N,int W,int *P){
    return;
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 344 KB Output is correct
2 Correct 10 ms 344 KB Output is correct
3 Correct 10 ms 456 KB Output is correct
4 Correct 10 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 352 KB Output isn't correct
2 Halted 0 ms 0 KB -