結果
問題 | No.2219 Re:010 |
ユーザー |
|
提出日時 | 2023-02-18 08:29:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 503 bytes |
コンパイル時間 | 1,890 ms |
コンパイル使用メモリ | 195,696 KB |
最終ジャッジ日時 | 2025-02-10 18:49:36 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 WA * 16 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; int main(){ string s; cin >> s; vector<ll> dp(4); dp[0]=1; for(auto& c : s){ vector<ll> ndp=dp; if(c=='?'){ for(auto& x : ndp) x*=2; } if(c!='1'){ ndp[1]=(ndp[1]+dp[0])%998244353; ndp[3]=(ndp[3]+dp[2])%998244353; } if(c!='0'){ ndp[2]=(ndp[2]+dp[1])%998244353; } swap(ndp,dp); } cout<<dp[3]<<'\n'; }