hiho week 41 register

Ended

Participants:3476

Verdict:Accepted
Score:100 / 100
Submitted:2015-04-13 19:28:10

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
int main()
{
    int N;
    scanf("%d", &N);
    int p[3]={1,2,3};
    for(int i=0; i<=N-3; i++)
    {
        p[(i+2)%3]=(p[(i+1)%3]+p[i%3])%19999997;
    }
    printf("%d\n", p[(N-1)%3]);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX