# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
62608 | imsifile | Cross on the Grid (FXCUP3_cross) | C++14 | 3 ms | 540 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#include<memory.h>
typedef long long lld;
const lld mod = 1000000007;
struct mat {
lld ba[9][9];
mat operator* (const mat &c){
mat res; memset(res.ba, 0, sizeof(res.ba));
for(int i=0; i<9; i++){
for(int j=0; j<9; j++){
for(int k=0; k<9; k++) res.ba[i][j] += ba[i][k]*c.ba[k][j];
res.ba[i][j] %= mod;
}
}
return res;
}
} base, res;
int N;
int main(){
scanf("%d", &N); N-=4;
if(N<0){ puts("4"); return 0; }
memset(base.ba, 0, sizeof(base.ba));
memset(res.ba, 0, sizeof(res.ba));
for(int i=0; i<9; i++) res.ba[i][i] = 1;
base.ba[0][0] = base.ba[0][1] = base.ba[0][2] = base.ba[0][3] = 1;
base.ba[1][4] = base.ba[1][5] = base.ba[2][6] = base.ba[3][7] = base.ba[3][8] = 1;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |