結果

問題 No.1439 Let's Compare!!!!
ユーザー lloyzlloyz
提出日時 2022-02-15 18:58:19
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,594 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 105,500 KB
最終ジャッジ日時 2023-09-11 17:01:25
合計ジャッジ時間 10,901 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,116 KB
testcase_01 AC 72 ms
71,108 KB
testcase_02 AC 69 ms
71,392 KB
testcase_03 AC 69 ms
71,400 KB
testcase_04 AC 69 ms
71,236 KB
testcase_05 AC 71 ms
71,408 KB
testcase_06 AC 70 ms
71,168 KB
testcase_07 AC 132 ms
78,432 KB
testcase_08 AC 152 ms
79,012 KB
testcase_09 AC 116 ms
78,616 KB
testcase_10 AC 663 ms
102,900 KB
testcase_11 AC 604 ms
103,104 KB
testcase_12 AC 582 ms
102,828 KB
testcase_13 AC 693 ms
103,088 KB
testcase_14 AC 698 ms
102,912 KB
testcase_15 AC 584 ms
103,360 KB
testcase_16 AC 598 ms
103,424 KB
testcase_17 AC 637 ms
103,468 KB
testcase_18 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = list(map(int, list(input())))
T = list(map(int, list(input())))
op_idx = n
for i in range(n):
    if S[i] != T[i]:
        op_idx = i
        break

q = int(input())
for _ in range(q):
    c, x, y = input().split()
    x = int(x)
    y = int(y)
    x -= 1
    if c == 'S':
        if S[x] != y:
            S[x] = y
        else:
            if op_idx == n:
                print('=')
            elif S[op_idx] > T[op_idx]:
                print('>')
            elif S[op_idx] < T[op_idx]:
                print('<')
            continue
    elif c == 'T':
        if T[x] != y:
            T[x] = y
        else:
            if op_idx == n:
                print('=')
            elif S[op_idx] > T[op_idx]:
                print('>')
            elif S[op_idx] < T[op_idx]:
                print('<')
            continue
    if x > op_idx:
        if S[op_idx] > T[op_idx]:
            print('>')
        elif S[op_idx] < T[op_idx]:
            print('<')
    elif x < op_idx:
        if S[x] > T[x]:
            print('>')
        elif S[x] < T[x]:
            print('<')
        op_idx = x
    else:
        if S[x] > T[x]:
            print('>')
        elif S[x] < T[x]:
            print('<')
        else:
            op_idx = n
            for i in range(x + 1, n):
                if S[i] > T[i]:
                    print('>')
                    op_idx = i
                    break
                if S[i] < T[i]:
                    print('<')
                    op_idx = i
                    break
            if op_idx == n:
                print('=')
0