Submission #322002

#TimeUsernameProblemLanguageResultExecution timeMemory
322002EndRayKangaroo (CEOI16_kangaroo)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; const int N = 2000+1, mod = 1e9+7; int n, i, j; map<int, map<int, ll>> mp[N]; ll A[] = {1, 2, 16, 272, 7936} ll f(int n, int i, int j){ if(j == 1) return n == 1; if(i == 1 && j == 2){ if((n&1) == 0) return 0; return A[(n-2)/2]; } if(mp[n].find(i) != mp[n].end() && mp[n][i].find(j) != mp[n][i].end()) goto END; if(i == 1){ if(n&1) mp[n][i][j] = f(n, 1, j-1) - f(n-1, 1, j-1); else mp[n][i][j] = f(n, 1, j-1) + f(n-1, 1, j-1); } else if(i == 2) mp[n][i][j] = f(n, 1, j) + f(n-1, 1, j-1); else mp[n][i][j] = 2*f(n, i-1, j) - f(n, i-2, j) - f(n-2, i-2, j-2); mp[n][i][j] %= mod; END: return mp[n][i][j]; } int main(){ ios_base::sync_with_stdio(false); cout.tie(0); cin.tie(0); cin >> n >> i >> j; cout << f(n, i, j); }

Compilation message (stderr)

kangaroo.cpp:2:12: error: expected ',' or ';' before 'long'
    2 | #define ll long long
      |            ^~~~
kangaroo.cpp:14:1: note: in expansion of macro 'll'
   14 | ll f(int n, int i, int j){
      | ^~
kangaroo.cpp: In function 'int main()':
kangaroo.cpp:41:13: error: 'f' was not declared in this scope
   41 |     cout << f(n, i, j);
      |             ^