hiho week 43 register

Ended

Participants:830

Verdict:Accepted
Score:100 / 100
Submitted:2015-04-26 10:19:24

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//hiho43
#include<algorithm>
#include<cassert>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
const int M=12357;
int main(){
    int N;
    int K;
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
    while(2==scanf("%u%u",&K,&N)){
        if((K*N)&1){
            puts("0");
            continue;
        }
        if(K==2){
            a=0;
            b=1;
            while(N--){c=(b+a)%M;a=b;b=c;}
            printf("%u\n",c%M);
            continue;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX