Submission #227335

#TimeUsernameProblemLanguageResultExecution timeMemory
227335dextro동전 게임 (KOI15_coin)C++14
9 / 100
29 ms768 KiB
#include <bits/stdc++.h> using namespace std; int K,C; int ispossible(int n, int m, int round, int who) { if(round==0) return 1; if(who==1){ if(round!=C && m+C-round<n) return 0; return ispossible(n,m,round,0) || ispossible(n,m-1,round,0); } else{ if(n+C-round<m) return 0; return ispossible(n,m,round-1,1) || ispossible(n-1,m,round-1,1); } } int main() { scanf("%d %d",&K,&C); int n,m; for(int i=0; i<C; i++){ scanf("%d %d",&n,&m); printf("%d\n",ispossible(n,m,C,1)); } return 0; }

Compilation message (stderr)

coin.cpp: In function 'int main()':
coin.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&K,&C);
     ~~~~~^~~~~~~~~~~~~~~
coin.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&n,&m);
         ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...