제출 #49340

#제출 시각아이디문제언어결과실행 시간메모리
493403zp캥거루 (CEOI16_kangaroo)C++14
36 / 100
2073 ms56668 KiB
#include<bits/stdc++.h> using namespace std; int dp[209][209][209][3]; int mod = 1e9+ 7; main(){ int n,l,r; cin >> n >> l >> r; dp[1][1][1][1] = 1; dp[1][1][1][0] = 1; for(int N = 2; N <= n; N++){ for(int L = 1; L <= n; L++){ for(int R = 1; R <= n; R++){ for(int D = 0; D < 2; D++){ if(L == R) continue; if(D == 0){ for(int nL = L + 1; nL <= N; nL++){ int nR = R; if(R > L) nR--; dp[N][L][R][D] += dp[N - 1][nL - 1][nR][1 - D]; if(dp[N][L][R][D] > mod) dp[N][L][R][D] -= mod; } } else { for(int nL = L - 1; nL >= 1; nL--){ int nR = R; if(R > L) nR--; dp[N][L][R][D] += dp[N - 1][nL][nR][1 - D]; if(dp[N][L][R][D] > mod) dp[N][L][R][D] -= mod; } } } } } } cout << (dp[n][l][r][0] + dp[n][l][r][1]) % mod << endl; }

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

kangaroo.cpp:5:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...