結果
問題 |
No.1439 Let's Compare!!!!
|
ユーザー |
![]() |
提出日時 | 2021-03-28 14:52:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 442 ms / 2,000 ms |
コード長 | 945 bytes |
コンパイル時間 | 2,062 ms |
コンパイル使用メモリ | 176,404 KB |
実行使用メモリ | 12,032 KB |
最終ジャッジ日時 | 2024-11-29 09:07:18 |
合計ジャッジ時間 | 6,663 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2021.03.28 14:51:59 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n;cin >> n; string s,t;cin >> s >> t; int q;cin >> q; set<int> st; vector<bool> exist(n,false); for (int i = 0; i < n; i++) if (s[i] != t[i]) st.insert(i), exist[i]=true; while(q--) { char c; int x,y;cin >> c >> x >> y; if (c == 'S') s[x-1] = char(y+'0'); else t[x-1] = char(y+'0'); if (s[x-1] != t[x-1]) { if (!exist[x-1]) st.insert(x-1); exist[x-1]=true; } else { if (exist[x-1]) st.erase(x-1); exist[x-1]=false; } if (st.empty()) cout << "=" << endl; else { int k = *(st.begin()); if (s[k] < t[k]) cout << '<' << endl; else cout << '>' << endl; } } return 0; }