Submission #493314

#TimeUsernameProblemLanguageResultExecution timeMemory
493314jamezzzKoala Game (APIO17_koala)C++17
11 / 100
26 ms316 KiB
#include "koala.h" #include <bits/stdc++.h> using namespace std; #define pf printf int n,b[105],r[105]; void reset(){ memset(b,0,sizeof b); } void play(){ playRound(b,r); #ifdef DEBUG for(int i=0;i<n;++i)pf("%2d ",b[i]);pf("\n"); for(int i=0;i<n;++i)pf("%2d ",r[i]);pf("\n"); #endif } int minValue(int N, int W) { // TODO: Implement Subtask 2 solution here. // You may leave this function unmodified if you are not attempting this // subtask. n=N; reset(); b[0]=1; play(); int ans=0; if(r[0]==2){ for(int i=0;i<n;++i)if(r[i]==0)ans=i; } return ans; } int maxValue(int N, int W) { // TODO: Implement Subtask 2 solution here. // You may leave this function unmodified if you are not attempting this // subtask. n=N; reset(); for(int i=0;i<n;++i)b[i]=1; play(); for(int k=2;k<9;++k){ reset(); for(int i=0;i<n;++i)if(r[i]==k)b[i]=k; play(); } for(int i=0;i<n;++i)if(r[i]==9)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. n=N; return 0; } void allValues(int N, int W, int *P) { n=N; 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 (stderr)

koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:52:1: warning: control reaches end of non-void function [-Wreturn-type]
   52 | }
      | ^
#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...