結果

問題 No.1439 Let's Compare!!!!
ユーザー bonKotsu
提出日時 2021-04-21 00:48:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 486 ms / 2,000 ms
コード長 780 bytes
コンパイル時間 1,625 ms
コンパイル使用メモリ 174,920 KB
実行使用メモリ 12,032 KB
最終ジャッジ日時 2024-07-04 05:38:40
合計ジャッジ時間 6,728 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>

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);

  rep(i, q) {
    char c;
    int x, y;
    cin >> c >> x >> y;
    x--;
    if (c == 'S') s[x] = y+'0';
    else t[x] = y+'0';

    if (s[x]!=t[x]) st.insert(x);
    else if (s[x]==t[x]) st.erase(x);

    bool flag = false;

    if (st.size() == 0) {
      cout << "=" << endl;
      continue;
    }
    
    for (auto idx : st) {
      flag = true;
      if (s[idx] > t[idx]) cout << ">" << endl;
      else if (s[idx] < t[idx]) cout << "<" << endl;
      if (flag) break;
    }

  }

}
0