結果
| 問題 | No.3751 Nonopoly |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-24 19:58:01 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 156 ms / 2,000 ms |
| + 292µs | |
| コード長 | 198 bytes |
| 記録 | |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 64,340 KB |
| 実行使用メモリ | 62,776 KB |
| 最終ジャッジ日時 | 2026-11-24 19:58:13 |
| 合計ジャッジ時間 | 11,033 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 50 |
ソースコード
N,M=map(int,input().split())
a=[0]*N
for i in range(M):
u,v,w=map(int,input().split())
a[u-1]+=w
a[v-1]+=w
a.sort(reverse=True)
ans=0
s=1
for i in a:
ans+=i*s
s*=-1
print(ans//2)