Submission #18443

# Submission time Handle Problem Language Result Execution time Memory
18443 2016-02-02T10:23:58 Z chan492811 동전 게임 (KOI15_coin) C++
100 / 100
24 ms 1084 KB
#include <cstdio>
#include <algorithm>
using namespace std;
int n,m;
int main(){
    int i,a,s,l;
    scanf("%d %d",&n,&m);
    for(i=0;i<m;i++){
        scanf("%d %d",&a,&s);
        if(a>s) a--;
        l=n-max(a,s);
        if(s>a){
            if(s-a<=l+1) printf("1\n");
            else printf("0\n");
        }else{
            if(a-s<=l) printf("1\n");
            else printf("0\n");
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 2 ms 1084 KB Output is correct
4 Correct 23 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 16 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 22 ms 1084 KB Output is correct
7 Correct 8 ms 1084 KB Output is correct
8 Correct 24 ms 1084 KB Output is correct