結果

問題 No.740 幻の木
ユーザー banningbanning
提出日時 2018-10-05 22:46:55
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 7,880 KB
最終ジャッジ日時 2023-08-02 17:17:48
合計ジャッジ時間 811 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,880 KB
testcase_01 AC 17 ms
7,828 KB
testcase_02 AC 16 ms
7,820 KB
testcase_03 AC 15 ms
7,868 KB
testcase_04 AC 16 ms
7,804 KB
testcase_05 AC 16 ms
7,776 KB
testcase_06 AC 16 ms
7,800 KB
testcase_07 AC 15 ms
7,800 KB
testcase_08 AC 16 ms
7,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
from sys import stdin

n, m, p, q = [int(x) for x in stdin.readline().rstrip().split()]

cal = [int(0) for i in range(12)]
for i in range(p-1, p-1+q):
    cal[i] += 1

year = n // (m * (12+q))
ans = 12 * year

nokori = n % (m * (12+q))

for i in range(12):
    if cal[i]:
        nokori -= 2*m
    else:
        nokori -= m
    ans += 1
    if nokori <= 0:
        break
print(ans)
0