제출 #495333

#제출 시각아이디문제언어결과실행 시간메모리
495333VladM캥거루 (CEOI16_kangaroo)C++14
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; #define modulo 1000000007 long long n, dp[2007][2007], f, cs, cf; int main() { freopen("kangaroo.in", "r", stdin); freopen("kangaroo.out", "w", stdout); cin>>n>>cs>>cf; dp[0][0]=1; for(long long i=1; i<=n; i++){ for(long long j=1; j<=n; j++){ if(i==cs || i==cf){ dp[i][j]=(dp[i-1][j-1]+dp[i-1][j])%modulo; continue; } if(i<cs) dp[i][j]=j*(dp[i-1][j-1]+dp[i-1][j+1]); else if(i<cf) dp[i][j]=dp[i-1][j-1]*(j-1)+dp[i-1][j+1]*j; else dp[i][j]=dp[i-1][j-1]*(j-2)+dp[i-1][j+1]*j; dp[i][j]%=modulo; } } cout<<dp[n][1]; return 0; }

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

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:11:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     freopen("kangaroo.in", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
kangaroo.cpp:12:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     freopen("kangaroo.out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...