結果
問題 | No.1439 Let's Compare!!!! |
ユーザー |
![]() |
提出日時 | 2021-03-26 22:25:56 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,760 bytes |
コンパイル時間 | 221 ms |
コンパイル使用メモリ | 82,348 KB |
実行使用メモリ | 108,388 KB |
最終ジャッジ日時 | 2024-11-29 08:51:07 |
合計ジャッジ時間 | 6,529 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 TLE * 1 |
ソースコード
import sysinput = lambda: sys.stdin.readline().rstrip()n = int(input())S = list(map(int, input()))T = list(map(int, input()))D = [S[i]-T[i] for i in range(n)]status = 'e'checked = 0for d in D:if d > 0:status = 's'breakelif d < 0:status = 't'breakelse:checked += 1q = int(input())Ans = [None]*qfor j in range(q):c, x, y = input().split()x, y = int(x), int(y)if c == 'S':df = y-S[x-1]S[x-1] = yelse:df = T[x-1]-yT[x-1] = yif df:D[x-1] += dfif status == 'e':checked = x-1if df > 0:status = 's'else:status = 't'elif status == 's':if checked >= x-1:checked = x-1for i in range(x-1, n):d = D[i]if d > 0:breakelif d < 0:status = 't'breakelse:checked += 1if checked == n:status = 'e'else:if checked >= x-1:checked = x-1for i in range(x-1, n):d = D[i]if d > 0:status = 's'breakelif d < 0:breakelse:checked += 1if checked == n:status = 'e'if status == 's':Ans[j] = '>'elif status == 'e':Ans[j] = '='else:Ans[j] = '<'print(*Ans, sep = '\n')