結果

問題 No.580 旅館の予約計画
ユーザー rlangevinrlangevin
提出日時 2024-01-12 08:56:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 68,396 KB
最終ジャッジ日時 2024-01-12 08:56:37
合計ジャッジ時間 4,440 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 36 ms
53,460 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 43 ms
59,448 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 42 ms
59,832 KB
testcase_10 AC 42 ms
59,448 KB
testcase_11 AC 42 ms
59,448 KB
testcase_12 AC 46 ms
61,948 KB
testcase_13 AC 43 ms
59,704 KB
testcase_14 AC 45 ms
61,752 KB
testcase_15 AC 56 ms
66,324 KB
testcase_16 AC 54 ms
66,324 KB
testcase_17 AC 53 ms
66,324 KB
testcase_18 AC 54 ms
66,324 KB
testcase_19 AC 52 ms
66,324 KB
testcase_20 AC 52 ms
66,196 KB
testcase_21 AC 54 ms
66,312 KB
testcase_22 AC 48 ms
63,744 KB
testcase_23 AC 52 ms
66,328 KB
testcase_24 AC 52 ms
66,332 KB
testcase_25 AC 51 ms
66,184 KB
testcase_26 AC 41 ms
59,468 KB
testcase_27 AC 40 ms
59,468 KB
testcase_28 AC 37 ms
53,460 KB
testcase_29 AC 37 ms
53,460 KB
testcase_30 AC 55 ms
68,396 KB
testcase_31 AC 55 ms
66,324 KB
testcase_32 AC 55 ms
68,392 KB
testcase_33 AC 53 ms
66,324 KB
testcase_34 AC 54 ms
68,388 KB
testcase_35 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def f(d, hm):
    d = int(d)
    h, m = map(int, hm.split(":"))
    return d * 1440 + h * 60 + m

N, M = map(int, input().split())
D = []
for i in range(M):
    d1, hm1, d2, hm2 = input().split()
    D.append((f(d2, hm2), f(d1, hm1)))
    
D.sort()
ans = 0
now = [-1] * N
for r, l in D:
    ind = -1
    maxv = -10
    for i in range(N):
        if now[i] < l and now[i] > maxv:
            ind = i
            maxv = now[i]
    if ind == -1:
        continue
    ans += 1
    now[ind] = r
    
print(ans)
0