結果
問題 | No.1439 Let's Compare!!!! |
ユーザー |
![]() |
提出日時 | 2021-03-26 21:41:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 404 ms / 2,000 ms |
コード長 | 1,325 bytes |
コンパイル時間 | 1,609 ms |
コンパイル使用メモリ | 174,824 KB |
実行使用メモリ | 12,032 KB |
最終ジャッジ日時 | 2024-11-29 08:38:59 |
合計ジャッジ時間 | 6,387 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll,ll> P; typedef vector<ll> VI; typedef vector<VI> VVI; #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() constexpr ll MOD=998244353; constexpr ll INF=2e18; int main(){ int n; cin >> n; string s, t; cin >> s >> t; int q; cin >> q; set<int> st; REP(i,n){ if(s[i]!=t[i]) st.insert(i); } char c; int x, y; while(q--){ cin >> c >> x >> y; x--; if(c=='S'){ if(s[x]!=t[x]){ s[x]=(char)('0'+y); if(s[x]==t[x]) st.erase(x); } else{ s[x]=(char)('0'+y); if(s[x]!=t[x]) st.insert(x); } } else{ if(s[x]!=t[x]){ t[x]=(char)('0'+y); if(s[x]==t[x]) st.erase(x); } else{ t[x]=(char)('0'+y); if(s[x]!=t[x]) st.insert(x); } } if(st.empty()) cout << "=" << endl; else if(s[*st.begin()]>t[*st.begin()]) cout << ">" << endl; else cout << "<" << endl; } return 0; }