結果
| 問題 |
No.2535 多重同値
|
| コンテスト | |
| ユーザー |
nonon
|
| 提出日時 | 2023-11-10 21:55:17 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 547 bytes |
| コンパイル時間 | 1,960 ms |
| コンパイル使用メモリ | 193,776 KB |
| 最終ジャッジ日時 | 2025-02-17 20:41:58 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 15 |
ソースコード
#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[1][1]=1;
for(int i=2;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][1]=dp[i-1][0];
}
}
for(int i=1;i<=N;i++)cout<<(dp[i][P[i]]?"Yes\n":"No\n");
}
nonon