結果

問題 No.740 幻の木
コンテスト
ユーザー takakin
提出日時 2020-05-07 22:37:14
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 211 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 507 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-03-24 17:29:43
合計ジャッジ時間 2,116 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input=lambda: sys.stdin.readline().rstrip()
n,m,p,q=map(int,input().split())
y=m*(12+q)
ans=(n//y)*12
n%=y
now=1
while n>0:
  ans+=1
  if p<=now<=p+q-1:
    n-=2*m
  else:
    n-=m
  now+=1
print(ans)
0