結果

問題 No.1439 Let's Compare!!!!
ユーザー lloyzlloyz
提出日時 2022-02-15 18:55:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,599 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 86,824 KB
実行使用メモリ 103,580 KB
最終ジャッジ日時 2023-09-11 17:01:11
合計ジャッジ時間 8,759 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,264 KB
testcase_01 AC 75 ms
71,188 KB
testcase_02 AC 75 ms
71,420 KB
testcase_03 AC 77 ms
71,216 KB
testcase_04 AC 77 ms
71,084 KB
testcase_05 AC 75 ms
71,192 KB
testcase_06 AC 74 ms
71,220 KB
testcase_07 AC 148 ms
78,360 KB
testcase_08 AC 162 ms
78,940 KB
testcase_09 AC 124 ms
78,272 KB
testcase_10 AC 710 ms
102,824 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 697 ms
102,988 KB
testcase_14 AC 746 ms
102,796 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = list(map(int, list(input())))
T = list(map(int, list(input())))
op_idx = -1
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 == -1:
                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 == -1:
                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 = -1
            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 == -1:
                print('=')
0