結果
| 問題 |
No.568 じゃんじゃん 落とす 委員会
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-16 02:41:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 711 bytes |
| コンパイル時間 | 156 ms |
| コンパイル使用メモリ | 82,500 KB |
| 実行使用メモリ | 95,884 KB |
| 最終ジャッジ日時 | 2024-09-28 02:25:57 |
| 合計ジャッジ時間 | 6,810 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 WA * 1 |
ソースコード
N,M=map(int,input().split())
W=10**5+10
C=[0,0,0,0,0,0]
A=[[] for i in range(W)]
B=[[] for i in range(W)]
Student=[]
for i in range(N):
x,a,b=map(int,input().split())
Student.append(x+1)
A[a].append(i)
B[b].append(i)
C[x+1]+=1
#print(C)
SA=0
SB=100000
ans=2**60
while SA<100000:
#print(SA,SB,C)
if sum(C[2:])>=M and sum(C[3:])<ans:
ans=sum(C[3:])
for ids in A[SA]:
C[Student[ids]]-=1
Student[ids]-=1
C[Student[ids]]+=1
SA+=1
while SB>0 and sum(C[2:])<M:
#print(C,sum(C[2:]),M)
SB-=1
for ids in B[SB]:
C[Student[ids]]-=1
Student[ids]+=1
C[Student[ids]]+=1
print(ans)