結果

問題 No.1439 Let's Compare!!!!
ユーザー roarisroaris
提出日時 2021-03-26 21:54:18
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 416 ms / 2,000 ms
コード長 764 bytes
コンパイル時間 5,799 ms
コンパイル使用メモリ 206,396 KB
実行使用メモリ 12,028 KB
最終ジャッジ日時 2023-08-19 15:18:07
合計ジャッジ時間 7,346 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 7 ms
4,380 KB
testcase_08 AC 12 ms
4,380 KB
testcase_09 AC 5 ms
4,380 KB
testcase_10 AC 416 ms
11,620 KB
testcase_11 AC 369 ms
6,848 KB
testcase_12 AC 352 ms
7,120 KB
testcase_13 AC 414 ms
12,028 KB
testcase_14 AC 415 ms
11,868 KB
testcase_15 AC 342 ms
4,384 KB
testcase_16 AC 300 ms
4,384 KB
testcase_17 AC 288 ms
4,388 KB
testcase_18 AC 282 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    int N; cin >> N;
    string S, T; cin >> S >> T;
    set<int> s;
    rep(i, N) if (S[i]!=T[i]) s.insert(i);
    
    int Q; cin >> Q;
    while (Q--) {
        char c;
        int x;
        char y;
        cin >> c >> x >> y;
        x--;
        
        if (c=='S') S[x] = y;
        else T[x] = y;
        
        if (s.find(x)!=s.end() && S[x]==T[x]) s.erase(x);
        if (s.find(x)==s.end() && S[x]!=T[x]) s.insert(x);
        
        if (s.size()==0) cout << '=' << endl;
        else if (S[*s.begin()]>T[*s.begin()]) cout << '>' << endl;
        else cout << '<' << endl;
    }
}
0