Submission #172739

#TimeUsernameProblemLanguageResultExecution timeMemory
172739dndhkKoala Game (APIO17_koala)C++14
19 / 100
45 ms504 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...