結果

問題 No.580 旅館の予約計画
ユーザー akitsugu777akitsugu777
提出日時 2019-09-05 15:16:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 8,428 KB
最終ジャッジ日時 2023-09-02 10:14:08
合計ジャッジ時間 2,927 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,976 KB
testcase_01 AC 16 ms
7,868 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 16 ms
7,820 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 17 ms
8,016 KB
testcase_07 AC 17 ms
7,836 KB
testcase_08 AC 16 ms
7,860 KB
testcase_09 AC 16 ms
7,856 KB
testcase_10 AC 17 ms
7,768 KB
testcase_11 AC 17 ms
7,840 KB
testcase_12 AC 19 ms
7,848 KB
testcase_13 AC 17 ms
7,824 KB
testcase_14 AC 19 ms
8,024 KB
testcase_15 AC 37 ms
8,356 KB
testcase_16 AC 29 ms
8,272 KB
testcase_17 AC 29 ms
8,396 KB
testcase_18 AC 29 ms
8,344 KB
testcase_19 AC 34 ms
8,348 KB
testcase_20 AC 26 ms
8,272 KB
testcase_21 AC 26 ms
8,412 KB
testcase_22 AC 21 ms
8,392 KB
testcase_23 AC 23 ms
8,228 KB
testcase_24 AC 24 ms
8,428 KB
testcase_25 AC 24 ms
8,344 KB
testcase_26 AC 16 ms
7,768 KB
testcase_27 AC 16 ms
7,832 KB
testcase_28 AC 16 ms
7,824 KB
testcase_29 AC 15 ms
7,836 KB
testcase_30 AC 23 ms
8,272 KB
testcase_31 AC 27 ms
8,256 KB
testcase_32 AC 23 ms
8,364 KB
testcase_33 AC 34 ms
8,352 KB
testcase_34 AC 23 ms
8,264 KB
testcase_35 AC 16 ms
7,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())

l = []
x = 0
y = 0
for _ in range(m):
    a, b, c, d = input().split()
    x += int(a) * 60 * 24
    e, f = map(int, b.split(':'))
    x += e*60 + f
    y += int(c) * 60 * 24
    g, h = map(int, d.split(':'))
    y += g*60 + h
    l.append([y, x])
    x = 0
    y = 0
l = sorted(l)
# print(l)

r = [0] * n
z = 0
for i in range(m):
    for j in range(n):
        if r[j] < l[i][1]:
            r[j] = l[i][0]
            z += 1
            r = sorted(r)[::-1]
            l[i][1] = 0
            # print(r)

print(z)
0