# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
71706 | 2018-08-25T12:33:39 Z | the_general(#2235, dbtlswkdrnss) | 십자가 놓기 (FXCUP3_cross) | C++ | 1000 ms | 600 KB |
#include<stdio.h> #define MOD 1000000007 int a(int); int b(int); int c(int); int d(int); int n; int a(int x){ if(x<3) return 0; if(x==3) return 1; return (((c(x-2)+d(x-3)-b(x-3))%MOD+b(x-2))%MOD+d(x-3))%MOD; } int b(int x){ if(x<3) return 0; if(x==3) return 1; return (((c(x-2)+d(x-3)-a(x-3))%MOD+a(x-2))%MOD+d(x-3))%MOD; } int c(int x){ if(x<3) return 0; if(x==3) return 1; return ((a(x-2)+b(x-2))%MOD+d(x-3))%MOD; } int d(int x){ if(x==1 || x==2) return 1; return (((a(x)+b(x))%MOD+c(x))%MOD+d(x-1))%MOD; } int main(){ scanf("%d", &n); printf("%d", (d(n))%MOD); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 248 KB | Output is correct |
2 | Correct | 3 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 508 KB | Output is correct |
4 | Correct | 2 ms | 508 KB | Output is correct |
5 | Correct | 3 ms | 516 KB | Output is correct |
6 | Correct | 2 ms | 516 KB | Output is correct |
7 | Correct | 3 ms | 544 KB | Output is correct |
8 | Correct | 2 ms | 600 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 248 KB | Output is correct |
2 | Correct | 3 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 508 KB | Output is correct |
4 | Correct | 2 ms | 508 KB | Output is correct |
5 | Correct | 3 ms | 516 KB | Output is correct |
6 | Correct | 2 ms | 516 KB | Output is correct |
7 | Correct | 3 ms | 544 KB | Output is correct |
8 | Correct | 2 ms | 600 KB | Output is correct |
9 | Correct | 2 ms | 600 KB | Output is correct |
10 | Execution timed out | 1074 ms | 600 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 248 KB | Output is correct |
2 | Correct | 3 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 508 KB | Output is correct |
4 | Correct | 2 ms | 508 KB | Output is correct |
5 | Correct | 3 ms | 516 KB | Output is correct |
6 | Correct | 2 ms | 516 KB | Output is correct |
7 | Correct | 3 ms | 544 KB | Output is correct |
8 | Correct | 2 ms | 600 KB | Output is correct |
9 | Correct | 2 ms | 600 KB | Output is correct |
10 | Execution timed out | 1074 ms | 600 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |