結果
| 問題 | No.1439 Let's Compare!!!! | 
| コンテスト | |
| ユーザー |  ninoinui | 
| 提出日時 | 2021-03-27 00:11:42 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 160 ms / 2,000 ms | 
| コード長 | 1,814 bytes | 
| コンパイル時間 | 3,284 ms | 
| コンパイル使用メモリ | 208,052 KB | 
| 最終ジャッジ日時 | 2025-01-19 23:43:43 | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 17 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:48:20: warning: declaration of ‘a’ shadows a previous local [-Wshadow]
   48 |       const auto& [a, b] = *MA.begin();
      |                    ^
main.cpp:37:21: note: shadowed declaration is here
   37 |   for (const auto& [a, b, c] : V) {
      |                     ^
main.cpp:48:23: warning: declaration of ‘b’ shadows a previous local [-Wshadow]
   48 |       const auto& [a, b] = *MA.begin();
      |                       ^
main.cpp:37:24: note: shadowed declaration is here
   37 |   for (const auto& [a, b, c] : V) {
      |                        ^
main.cpp:49:20: warning: declaration of ‘c’ shadows a previous local [-Wshadow]
   49 |       const auto& [c, d] = b;
      |                    ^
main.cpp:37:27: note: shadowed declaration is here
   37 |   for (const auto& [a, b, c] : V) {
      |                           ^
            
            ソースコード
#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};
  }
  map<int, pair<char, char>> MA;
  for (int i = 0; i < N; i++) {
    if (S.at(i) != T.at(i)) MA[i] = {S.at(i), T.at(i)};
  }
  for (const auto& [a, b, c] : V) {
    if (a == 'S') S.at(b) = c;
    else T.at(b) = c;
    if (MA.count(b)) {
      if (S.at(b) == T.at(b)) MA.erase(b);
      else MA[b] = {S.at(b), T.at(b)};
    } else {
      if (S.at(b) != T.at(b)) MA[b] = {S.at(b), T.at(b)};
    }
    if ((int)MA.size() == 0) cout << '=' << '\n';
    else {
      const auto& [a, b] = *MA.begin();
      const auto& [c, d] = b;
      if (c < d) cout << '<' << '\n';
      else cout << '>' << '\n';
    }
  }
}
            
            
            
        