結果

問題 No.1439 Let's Compare!!!!
ユーザー ktr216ktr216
提出日時 2021-03-26 21:57:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 860 bytes
コンパイル時間 1,690 ms
コンパイル使用メモリ 168,292 KB
実行使用メモリ 9,232 KB
最終ジャッジ日時 2023-08-19 15:18:40
合計ジャッジ時間 6,918 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,760 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 3 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 74 ms
4,776 KB
testcase_11 AC 85 ms
4,900 KB
testcase_12 AC 84 ms
4,740 KB
testcase_13 AC 74 ms
4,572 KB
testcase_14 AC 75 ms
4,700 KB
testcase_15 AC 87 ms
4,660 KB
testcase_16 AC 86 ms
4,572 KB
testcase_17 AC 89 ms
4,636 KB
testcase_18 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef long long ll;

int main() {
    int N, Q;
    string S, T;
    cin >> N >> S >> T >> Q;
    vector<char> c(Q), y(Q);
    vector<int> x(Q);
    rep(i, Q) {
        cin >> c[i] >> x[i] >> y[i];
        x[i]--;
    }
    int idx = 0;
    while (idx < N && S[idx] == T[idx]) idx++;
    rep(i, Q) {
        if (c[i] == 'S') {
            S[x[i]] = y[i];
        } else {
            T[x[i]] = y[i];
        }
        if (x[i] == idx) {
            while (idx < N && S[idx] == T[idx]) idx++;
        } else if (x[i] < idx && S[x[i]] != T[x[i]]) {
            idx = x[i];
        }
        if (idx == N) {
            cout << "=\n";
        } else if (S[idx] < T[idx]) {
            cout << "<\n";
        } else {
            cout << ">\n";
        }
    }
}
0