結果

問題 No.1439 Let's Compare!!!!
ユーザー ninoinuininoinui
提出日時 2021-03-27 00:15:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,638 bytes
コンパイル時間 2,420 ms
コンパイル使用メモリ 213,256 KB
実行使用メモリ 14,336 KB
最終ジャッジ日時 2024-05-06 18:15:42
合計ジャッジ時間 3,991 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 WA -
testcase_02 AC 2 ms
6,944 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC diagnostic warning "-Wextra"
#pragma GCC diagnostic warning "-Wshadow"
#include <bits/stdc++.h>
using namespace std;

template <class A, class B> bool cmin(A& a, B b) { return a > b && (a = b, true); }
template <class A, class B> bool cmax(A& a, B b) { return a < b && (a = b, true); }
template <class A, class B> ostream& operator<<(ostream& os, pair<A, B>& p) { return os << '(' << p.first << ", " << p.second << ')'; }
static bool debug = false;
void dump() {}
template <class A, class... B> void dump(A&& a, B&&... b) { if (debug) cout << a << (sizeof...(b) ? ' ' : '\n'), dump(b...); }
template <class A> void dump1D(A& a) { if (debug) for (auto i = a.begin(); i != a.end(); i++) cout << *i << (next(i) != a.end() ? ' ' : '\n'); }
template <class A> void dump2D(A& a) { if (debug) for (auto i = a.begin(); i != a.end(); i++) dump1D(*i), cout << (next(i) != a.end() ? "" : "\n"); }

signed main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  debug = true;

  int N;
  cin >> N;
  string S, T;
  cin >> S >> T;
  int Q;
  cin >> Q;
  vector<tuple<char, int, char>> V(Q);
  for (int i = 0; i < Q; i++) {
    char a, c;
    int b;
    cin >> a >> b >> c, b--;
    V.at(i) = {a, b, c};
  }

  set<int> SE;
  for (int i = 0; i < N; i++) {
    if (S.at(i) != T.at(i)) SE.insert(i);
  }

  for (const auto& [a, b, c] : V) {
    if (a == 'S') S.at(b) = c;
    else T.at(b) = c;
    if (S.at(b) == T.at(b) && SE.count(b)) SE.erase(b);
    if ((int)SE.size()) {
      auto tmp = *SE.begin();
      if (S.at(tmp) < T.at(tmp)) cout << '<' << '\n';
      else cout << '>' << '\n';
    } else {
      cout << '=' << '\n';
    }
  }
}
0