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