結果
問題 | No.2535 多重同値 |
ユーザー |
![]() |
提出日時 | 2023-11-11 08:49:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 902 bytes |
コンパイル時間 | 3,489 ms |
コンパイル使用メモリ | 230,980 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-26 02:38:50 |
合計ジャッジ時間 | 4,550 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h>using namespace std;#include <atcoder/all>using namespace atcoder;#define rep(i, n) for(int i=0;i<(n);++i)#define rep1(i, n) for(int i=1;i<=(n);i++)#define ll long longusing mint = modint998244353;using P = pair<ll,ll>;using lb = long double;using T = tuple<ll, ll, ll>;#ifdef LOCAL# include <debug_print.hpp># define dbg(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)#else# define dbg(...) (static_cast<void>(0))#endifint main(){int n;cin >> n;vector<int> p(n);rep(i,n){string s;cin >> s;if(s=="Yes") p[i] = 1;else p[i] = 0;}int prev = 1;vector<string> ans(n);for(int i=0;i<n;i++){int now = p[i]^prev;if(now==0) ans[i] = "Yes";else ans[i] = "No";prev = now^1;}rep(i,n){cout << ans[i] << endl;}return 0;}