Submission #59368

# Submission time Handle Problem Language Result Execution time Memory
59368 2018-07-21T20:23:10 Z duality Koala Game (APIO17_koala) C++11
19 / 100
27 ms 636 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long int LLI;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
#include "koala.h"

int B[100],R[100];
int minValue(int N, int W) {
    int i;
    for (i = 0; i < N; i++) B[i] = 0;
    B[0] = 1;
    playRound(B,R);
    for (i = 0; i < N; i++) {
        if (R[i] == 0) return i;
    }
    return 0;
}

int maxValue(int N, int W) {
    int i;
    for (i = 0; i < N; i++) B[i] = 1;
    playRound(B,R);
    int c = 0;
    for (i = 0; i < N; i++) {
        if (R[i] == 2) B[i] = 2;
        else B[i] = 0;
    }
    playRound(B,R);
    for (i = 0; i < N; i++) {
        if (R[i] == 3) c++,B[i] = 4;
        else B[i] = 0;
    }
    playRound(B,R);
    for (i = 0; i < N; i++) {
        if (R[i] == 5) B[i] = 11;
        else B[i] = 0;
    }
    playRound(B,R);
    for (i = 0; i < N; i++) {
        if (R[i] == 12) return i;
    }
}

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.
    }
}

Compilation message

koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:46:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Correct 7 ms 376 KB Output is correct
2 Correct 7 ms 448 KB Output is correct
3 Correct 8 ms 452 KB Output is correct
4 Correct 8 ms 452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 452 KB Output is correct
2 Correct 27 ms 632 KB Output is correct
3 Correct 19 ms 632 KB Output is correct
4 Correct 19 ms 636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 636 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 636 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 636 KB Output isn't correct
2 Halted 0 ms 0 KB -