結果

問題 No.1439 Let's Compare!!!!
コンテスト
ユーザー a01sa01to
提出日時 2025-12-08 01:43:46
言語 C++23
(gcc 13.3.0 + boost 1.89.0)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 752 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,729 ms
コンパイル使用メモリ 281,276 KB
実行使用メモリ 12,008 KB
最終ジャッジ日時 2025-12-08 01:43:53
合計ジャッジ時間 5,827 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int n;
  string s, t;
  cin >> n >> s >> t;
  set<int> diff;
  rep(i, n) if (s[i] != t[i]) diff.insert(i);
  int q;
  cin >> q;
  while (q--) {
    char c;
    int x, y;
    cin >> c >> x >> y;
    --x;
    if (s[x] != t[x]) diff.erase(x);
    if (c == 'S') s[x] = y + '0';
    if (c == 'T') t[x] = y + '0';
    if (s[x] != t[x]) diff.insert(x);
    if (diff.empty()) {
      cout << '=' << '\n';
    }
    else {
      int i = *diff.begin();
      assert(s[i] != t[i]);
      cout << (s[i] < t[i] ? '<' : '>') << '\n';
    }
  }
  return 0;
}
0