CSES - HIIT Open 2019 - Results
 Task: Grid Paths Sender: O(n^10) Submission time: 2019-05-25 12:06:44 Language: C++ Status: READY Result: WRONG ANSWER
Test results
testverdicttime
#10.14 sdetails

### Code

```#include<bits/stdc++.h>
//ULVILAMAFIA&O(n^10)
typedef long long ll;
using namespace std;

ll taikaluku(ll n, ll m) {
ll g[n][m];
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
ll sum = 0;
if(i > 0) sum += g[i-1][j];
if(j > 0) sum += g[i][j-1];
if(sum == 0) { g[i][j] = 1; }
else { g[i][j] = sum; }
}
}
return g[n-1][m-1];
}

int main() {
//cout << "DEBUG: " << taikaluku(2,1) << "\n";
ll m = 1e9+7;
int n; cin >> n;
ll ss[n][n];
for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin >> ss[i][j];
ll je[n][n];
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
je[i][j] = taikaluku(i+1, j+1) * taikaluku(n-i, n-j);
}
}
//cout << "FUCK\n";
ll sum = 0;
//cout << "VAMMAFLAG" << "\n";
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
sum = (sum+(je[i][j]*ss[i][j])%m)%m;
}
}
if(sum < 0) sum += m;
cout << sum << "\n";
}

```

### Test details

#### Test 1

Verdict:

input
100
606755118 96655535 664126532 4...

correct output
530182530

user output
63095561