# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
71702 | 2018-08-25T12:12:23 Z | the_general(#2235, dbtlswkdrnss) | Cross on the Grid (FXCUP3_cross) | C++ | 3 ms | 404 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)+b(x-1)-a(x-2)+b(x-2)+d(x-3))%MOD; } int b(int x){ if(x<3) return 0; if(x==3) return 1; return (c(x-2)+a(x-1)-b(x-2)+a(x-2)+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)+d(x-3))%MOD; } int d(int x){ if(x==1 || x==2) return 1; return ((a(x)+b(x))%MOD+c(x)+d(x-1))%MOD; } int main(){ scanf("%d", &n); printf("%d", (d(n))%MOD); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 364 KB | Output is correct |
3 | Correct | 3 ms | 364 KB | Output is correct |
4 | Incorrect | 3 ms | 404 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 364 KB | Output is correct |
3 | Correct | 3 ms | 364 KB | Output is correct |
4 | Incorrect | 3 ms | 404 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 364 KB | Output is correct |
3 | Correct | 3 ms | 364 KB | Output is correct |
4 | Incorrect | 3 ms | 404 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |