結果

問題 No.1439 Let's Compare!!!!
ユーザー 👑 H20H20
提出日時 2021-03-26 21:48:50
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,202 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 82,604 KB
実行使用メモリ 113,308 KB
最終ジャッジ日時 2024-05-06 22:20:49
合計ジャッジ時間 10,079 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
59,764 KB
testcase_01 AC 36 ms
52,496 KB
testcase_02 AC 35 ms
52,688 KB
testcase_03 AC 36 ms
52,756 KB
testcase_04 AC 37 ms
53,288 KB
testcase_05 AC 37 ms
53,604 KB
testcase_06 AC 37 ms
52,276 KB
testcase_07 AC 103 ms
77,676 KB
testcase_08 AC 123 ms
77,412 KB
testcase_09 AC 87 ms
76,572 KB
testcase_10 AC 698 ms
108,848 KB
testcase_11 AC 609 ms
108,380 KB
testcase_12 AC 592 ms
108,624 KB
testcase_13 AC 685 ms
107,908 KB
testcase_14 AC 709 ms
108,520 KB
testcase_15 AC 592 ms
107,636 KB
testcase_16 AC 574 ms
106,652 KB
testcase_17 AC 615 ms
106,852 KB
testcase_18 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(input())
T = list(input())
Q = int(input())
for i in range(N):
    S[i]=int(S[i])
    T[i]=int(T[i])

state = 0  # [0:=] [1:>] [2:<]
for i in range(N):
    if S[i]<T[i]:
        state = 2
        break
    if S[i]>T[i]:
        state = 1
        break
difi = i

for i in range(Q):
    c,x,y=input().split()
    x=int(x)
    y=int(y)
    if c=='T':
        if T[x-1] == y:
            if state==0:
                print('=')
            elif state==1:
                print('>')
            else:
                print('<')
            continue
        else:
            T[x-1] = y
    else:
        if S[x-1] == y:
            if state==0:
                print('=')
            elif state==1:
                print('>')
            else:
                print('<')
            continue
        else:
            S[x-1] = y

    if difi>=x-1:
        for j in range(x-1,N):
            if S[j]<T[j]:
                state = 2
                break
            if S[j]>T[j]:
                state = 1
                break
        else:
            state=0
        difi = j

    if state==0:
        print('=')
    elif state==1:
        print('>')
    else:
        print('<')
0