結果
| 問題 |
No.1423 Triangle of Multiples
|
| コンテスト | |
| ユーザー |
toshiro_yanagi
|
| 提出日時 | 2025-04-09 22:04:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,661 ms / 2,000 ms |
| コード長 | 389 bytes |
| コンパイル時間 | 2,008 ms |
| コンパイル使用メモリ | 12,160 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2025-04-09 22:04:07 |
| 合計ジャッジ時間 | 5,189 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 |
ソースコード
from typing import NamedTuple
class T(NamedTuple):
v: int
c: str
def fun(s):
t = [T(x, chr(i + ord("x"))) for i, x in enumerate(s)]
t.sort()
while t[0].v + t[1].v <= t[2].v:
t[0] = T(t[0].v * 2, t[0].c)
t.sort()
t.sort(key=lambda x: x.c)
return [x.v for x in t]
for _ in range(int(input())):
print(*fun([*map(int, input().split())]))
toshiro_yanagi