結果
| 問題 |
No.1341 真ん中を入れ替えて門松列
|
| コンテスト | |
| ユーザー |
kozy
|
| 提出日時 | 2021-01-15 22:16:07 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 559 bytes |
| コンパイル時間 | 74 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,904 KB |
| 最終ジャッジ日時 | 2024-11-26 15:49:44 |
| 合計ジャッジ時間 | 1,570 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 11 WA * 3 |
ソースコード
N,M=map(int,input().split())
L=list()
R=list()
D=list()
for i in range(N):
A,B,C=map(int,input().split())
L.append(B)
R.append([A,B,C])
D.append([max(A,C),i])
if A==C:
print("NO")
exit()
L.sort()
L.reverse()
D.sort()
thi=0
ans=0
usiro=N-1
for i in range(N):
a,b=D[i]
if L[thi]>a:
ans+=L[thi]
else:
if L[usiro]<min(R[b][0],R[b][2]):
usiro=N-2
ans+=a
else:
print("NO")
exit()
print("YES")
if ans>=M:
print("KADOMATSU!")
else:
print("NO")
kozy