# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
172740 |
2020-01-02T13:46:47 Z |
dndhk |
Koala Game (APIO17_koala) |
C++14 |
|
71 ms |
504 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] = 4;
play();
if(ret[0]>4 && ret[1]>4){
arr[0] = arr[1] = 6;
play();
if(ret[0]>6 && ret[1]>6){
arr[0] = arr[1] = 9;
play();
if(ret[0]>9) return 0;
return 1;
}
if(ret[0]>6) return 0;
return 1;
}else if(ret[0]<=4 && ret[1]<=4){
arr[0] = arr[1] = 3;
play();
if(ret[0]<=3 && ret[1]<=3){
arr[0] = arr[1] = 2;
play();
if(ret[0]>2) return 0;
return 1;
}
if(ret[0]>3) return 0;
return 1;
}else{
if(ret[0]>4) 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 |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
376 KB |
Output is correct |
2 |
Correct |
16 ms |
380 KB |
Output is correct |
3 |
Correct |
16 ms |
504 KB |
Output is correct |
4 |
Correct |
16 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
376 KB |
Output is correct |
2 |
Incorrect |
3 ms |
504 KB |
Output isn't correct |
3 |
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 |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |