제출 #322003

#제출 시각아이디문제언어결과실행 시간메모리
322003EndRay캥거루 (CEOI16_kangaroo)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; const int N = 2000+1, mod = 1e9+7; int n, i, j; map<int, map<int, long long>> mp[N]; long long A[] = {1, 2, 16, 272, 7936} long long 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); }

컴파일 시 표준 에러 (stderr) 메시지

kangaroo.cpp:13:1: error: expected ',' or ';' before 'long'
   13 | long long f(int n, int i, int j){
      | ^~~~
kangaroo.cpp: In function 'int main()':
kangaroo.cpp:40:13: error: 'f' was not declared in this scope
   40 |     cout << f(n, i, j);
      |             ^