Submission #172743

# Submission time Handle Problem Language Result Execution time Memory
172743 2020-01-02T13:58:26 Z dndhk Koala Game (APIO17_koala) C++14
37 / 100
88 ms 908 KB
#include "koala.h"
#include <bits/stdc++.h>

#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define uniqv(v) (v).erase(unique(all(v)), (v).end())
#define pb push_back
#define FI first
#define SE second
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define test 1
#define TEST if(test)

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

const int MOD = 1000000007; // 998244353
const int INF = 2e9;
const ll INFLL = 1e18;
const int MAX_N = 100;

int arr[MAX_N+1], ret[MAX_N+1];


int minValue(int N, int W) {
    arr[0] = 1;
    playRound(arr, ret);
    if(ret[0]<2){
        return 0;
    }
    for(int i=1; i<N; i++){
        if(ret[i]<1){
            return i;
        }
    }
    return 0;}

void play(){
    playRound(arr, ret);
}

int maxValue(int N, int W) {
    for(int i=0 ;i<N; i++){
        arr[i] = 1;
    }
    play();
    for(int i=0; i<N; i++){
        if(ret[i]>1){
            arr[i] = 2;
        }else{
            arr[i] = 0;
        }
    }
    play();
    for(int i=0; i<N; i++){
        if(ret[i]>2 && arr[i]==2){
            arr[i] = 4;
        }else{
            arr[i] = 0;
        }
    }
    play();
    for(int i=0; i<N; i++){
        if(ret[i]>4 && arr[i]==4){
            arr[i] = 11;
        }else{
            arr[i] = 0;
        }
    }
    play();
    for(int i=0; i<N; i++){
        if(ret[i]>11 && arr[i]==11){
            return i;
        }
    }
    return 0;
}

int greaterValue(int N, int W) {
    arr[0] = arr[1] = 3;
    play();
    if(ret[0]>3 && ret[1]>3){
        arr[0] = arr[1] = 5;
        play();
        if(ret[0]>5 && ret[1]>5){
            arr[0] = arr[1] = 9;
            play();
            if(ret[0]>9)    return 0;
            return 1;
        }
        if(ret[0]>5)    return 0;
        return 1;
    }else if(ret[0]<=3 && ret[1]<=3){
        arr[0] = arr[1] = 2;
        play();
        if(ret[0]<=2 && ret[1]<=2){
            arr[0] = arr[1] = 1;
            play();
            if(ret[0]>1)   return 0;
            return 1;
        }
        if(ret[0]>2)    return 0;
        return 1;
    }
    if(ret[0]>3)    return 0;
    return 1;
}

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.
    }
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
4 Correct 6 ms 380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 16 ms 376 KB Output is correct
2 Correct 16 ms 376 KB Output is correct
3 Correct 16 ms 412 KB Output is correct
4 Correct 16 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 83 ms 376 KB Output is correct
2 Correct 86 ms 376 KB Output is correct
3 Correct 81 ms 888 KB Output is correct
4 Correct 81 ms 760 KB Output is correct
5 Correct 82 ms 760 KB Output is correct
6 Correct 83 ms 764 KB Output is correct
7 Correct 81 ms 760 KB Output is correct
8 Correct 88 ms 760 KB Output is correct
9 Correct 82 ms 760 KB Output is correct
10 Correct 83 ms 908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -