結果
| 問題 |
No.1439 Let's Compare!!!!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-14 16:59:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,097 bytes |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 21,316 KB |
| 最終ジャッジ日時 | 2024-06-26 12:41:05 |
| 合計ジャッジ時間 | 6,787 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 TLE * 1 -- * 7 |
ソースコード
def judge_which_larger(compare: list[str]) -> str:
for mark in compare:
if mark == "=":
continue
return mark
return "="
def main():
_ = input()
S = list(map(int, str(input())))
T = list(map(int, str(input())))
S_T_compare = []
for s_num, t_num in zip(S, T):
if s_num > t_num:
S_T_compare.append(">")
elif s_num == t_num:
S_T_compare.append("=")
else:
S_T_compare.append("<")
for _ in range(int(input())):
which_num, digit, number = input().split()
digit = int(digit)
number = int(number)
if which_num == "S":
S[digit-1] = number
elif which_num == "T":
T[digit-1] = number
else:
raise ValueError
if S[digit-1] > T[digit-1]:
S_T_compare[digit-1] = ">"
elif S[digit-1] == T[digit-1]:
S_T_compare[digit-1] = "="
else:
S_T_compare[digit-1] = "<"
print(judge_which_larger(S_T_compare))
if __name__ == "__main__":
main()