結果

問題 No.2535 多重同値
ユーザー nonon
提出日時 2023-11-10 21:47:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 1,944 ms
コンパイル使用メモリ 191,956 KB
最終ジャッジ日時 2025-02-17 20:37:02
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int N;
bool P[1<<17],dp[1<<17][2];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>N;
    for(int i=1;i<=N;i++){
        string S;
        cin>>S;
        P[i]=(S=="Yes");
    }
    dp[0][1]=1;
    for(int i=1;i<=N;i++){
        if(P[i]){
            dp[i][0]=dp[i-1][0];
            dp[i][1]=dp[i-1][1];
        }
        else{
            dp[i][0]=dp[i-1][1];
            dp[i][0]=dp[i-1][0];
        }
        cout<<(dp[i][P[i]]?"Yes\n":"No\n");
    }
}
0