답안 #172614

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
172614 2020-01-02T08:14:46 Z dndhk 코알라 (APIO17_koala) C++14
19 / 100
16 ms 532 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) {
    // 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.
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 368 KB Output is correct
2 Correct 7 ms 376 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
4 Correct 7 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 376 KB Output is correct
2 Correct 16 ms 532 KB Output is correct
3 Correct 16 ms 376 KB Output is correct
4 Correct 16 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -