結果
問題 |
No.2535 多重同値
|
ユーザー |
![]() |
提出日時 | 2023-11-10 22:07:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 508 bytes |
コンパイル時間 | 1,998 ms |
コンパイル使用メモリ | 193,192 KB |
最終ジャッジ日時 | 2025-02-17 20:51:34 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 15 |
ソースコード
#include<bits/stdc++.h> using namespace std; int N; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N; string pre,cur; bool ans; for(int i=1;i<=N;i++){ cin>>cur; if(i==1){ ans=cur=="Yes"; } else{ if(cur=="Yes"){ ans=(cur==pre?1-ans:ans); } else{ ans=(cur==pre?ans:1-ans); } } cout<<(ans?"Yes\n":"No\n"); pre=cur; } }