Submission #227335

# Submission time Handle Problem Language Result Execution time Memory
227335 2020-04-27T02:58:19 Z dextro 동전 게임 (KOI15_coin) C++14
9 / 100
29 ms 768 KB
#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

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 time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 4 ms 256 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 768 KB Output isn't correct
2 Halted 0 ms 0 KB -