結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
17,696 KB
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 56 ms
11,008 KB
testcase_08 AC 78 ms
10,752 KB
testcase_09 AC 47 ms
10,752 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 = N
for i in range(N):
    if S[i] != T[i]:
        D = i
        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-1 < D:
        D = x-1
    elif x-1 == D and S[D] == T[D]:
        for i in range(D+1, N):
            if S[i] != T[i]:
                D = i
                break
            
for _ in range(Q):
    s = input().split()
    c, x, y = s[0], int(s[1]), s[2]
    review(c, x)
    if D == N:
        print('-')
    else:
        print('>' if S[D] > T[D] else '<')
0