結果

問題 No.1439 Let's Compare!!!!
ユーザー 小野寺健小野寺健
提出日時 2021-05-14 17:16:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 806 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 19,204 KB
最終ジャッジ日時 2024-04-09 21:11:15
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
17,696 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 29 ms
10,880 KB
testcase_06 AC 28 ms
10,880 KB
testcase_07 AC 50 ms
10,880 KB
testcase_08 AC 73 ms
10,880 KB
testcase_09 AC 41 ms
10,880 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
T = input()
Q = int(input())

D = 0
for i in range(N):
    if S[i] != T[i]:
        D = i+1 if S[i] > T[i] else -i-1
        break
    
def review(c, x):
    global N, S, T, D
    if c == 'S':
        if S[x-1] == y:
            return
        S = S[0:x-1] + y + S[x:]
    else:
        if T[x-1] == y:
            return
        T = T[0:x-1] + y + T[x:]
    if x < abs(D):
        D = x if S[x-1] > T[x-1] else -x
    elif x == abs(D):
        D = 0
        for i in range(x-1, N):
            if S[i] != T[i]:
                D = i+1 if S[i] > T[i] else -i-1
                break
            
for _ in range(Q):
    s = input().split()
    c, x, y = s[0], int(s[1]), s[2]
    review(c, x)
    if D == 0:
        print('-')
    else:
        print('>' if D > 0 else '<')
    
0