結果
問題 |
No.580 旅館の予約計画
|
ユーザー |
![]() |
提出日時 | 2018-08-05 22:16:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 78 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-19 18:07:32 |
合計ジャッジ時間 | 2,291 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
n,m = map(int,input().split()) hotel = [] yoyaku = [] for i in range(m): y = input().split() y = [y[0]]+y[1].split(":")+[y[2]]+y[3].split(":") ci = int(y[0])*1440 + int(y[1])*60 + int(y[2]) co = int(y[3])*1440 + int(y[4])*60 + int(y[5]) yoyaku.append([ci,co]) cnt = 0 yoyaku.sort() for i in range(m): hotel.append(yoyaku[i][1]) len_h = len(hotel) for j in range(len_h-1,-1,-1): if hotel[j]<yoyaku[i][0]: del hotel[j] cnt+=1 if len(hotel)>n: hotel.sort() del hotel[-1] print(cnt+len(hotel))