結果

問題 No.90 品物の並び替え
ユーザー szkhts
提出日時 2025-08-10 08:33:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-08-10 08:33:13
合計ジャッジ時間 1,777 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())

item1 = []
item2 = []
score = []

for _ in range(m):
    i1, i2, s = map(int, input().split())
    item1.append(i1)
    item2.append(i2)
    score.append(s)
    
score1 = 0
score2 = 0

for i in range(m):
    if item1[i] < item2[i]:
        score1 += score[i]
        
for i in range(m):
    if item1[i] > item2[i]:
        score2 += score[i]
        
if score1 > score2:
    print(score1)
else:
    print(score2)
    
0