省略
省略
C++に変換後のコードはこちら
int N, P, A[50];
ll dp[2], nx[2];
{
rd(N,P,A(N));
dp[0] = 1;
rep(i,N){
rep(j,2) nx[j] = dp[j] + dp[(j+A[i])%2];
rep(j,2) dp[j] = nx[j];
}
wt(dp[P]);
}
Current time: 2024年03月29日14時31分32秒
Last modified: 2019年11月27日09時11分44秒 (by laycrs)
Tags: Competitive_Programming_Incomplete AtCoder AtCoder_Grand_Contest AGC017 AGC_A
トップページに戻る
Logged in as: unknown user (not login)