Submission #71706

#TimeUsernameProblemLanguageResultExecution timeMemory
71706the_general (#119)Cross on the Grid (FXCUP3_cross)C++98
22 / 100
1074 ms600 KiB
#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 (stderr)

cross.cpp: In function 'int main()':
cross.cpp:34:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...