結果
| 問題 |
No.1439 Let's Compare!!!!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-29 17:42:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 518 ms / 2,000 ms |
| コード長 | 726 bytes |
| コンパイル時間 | 4,343 ms |
| コンパイル使用メモリ | 255,856 KB |
| 最終ジャッジ日時 | 2025-02-21 09:40:16 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;
int main() {
int N; cin >> N;
string S, T; cin >> S >> T;
set<int> st;
for (int i = 0; i < N; i++) {
if (S[i] != T[i]) st.insert(i);
}
int Q; cin >> Q;
while (Q--) {
char c, y; int x; cin >> c >> x >> y;
if (c == 'S') {
S[x - 1] = y;
} else {
T[x - 1] = y;
}
if (S[x - 1] != T[x - 1]) st.insert(x - 1);
else st.erase(x - 1);
if (S[*st.begin()] > T[*st.begin()]) cout << '>' << endl;
else if (S[*st.begin()] < T[*st.begin()]) cout << '<' << endl;
else cout << '=' << endl;
}
return 0;
}