(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #23897

#제출 시각아이디문제언어결과실행 시간메모리
23897khsoo01캥거루 (CEOI16_kangaroo)C++11
100 / 100
26 ms33424 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1e9+7; ll n, s, e, dt[2005][2005]; ll solve (ll X, ll Y) { dt[n+1][0] = 1; ll ocu = 0; for(int i=n;i>=1;i--) { for(int j=1;j<=n-i+1;j++) { if(i == s) dt[i][j] = dt[i+1][j-X]; else if(i == e) dt[i][j] = dt[i+1][j-Y]; else dt[i][j] = (dt[i+1][j-1] * (j - ocu) + dt[i+1][j+1] * j) % mod; } if(i == s || i == e) ocu++; } return dt[1][1]; } int main() { scanf("%lld%lld%lld",&n,&s,&e); printf("%lld\n",(solve(0, (n+1)%2) + solve(1, n%2)) % mod); }

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

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:23:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld%lld%lld",&n,&s,&e);
                                ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...