結果

問題 No.740 幻の木
ユーザー banning
提出日時 2018-10-05 22:46:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-12 13:20:51
合計ジャッジ時間 966 ms
ジャッジサーバーID
(参考情報)
judge / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

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