結果

問題 No.740 幻の木
ユーザー URechaRecha
提出日時 2019-09-09 15:48:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-28 12:24:11
合計ジャッジ時間 1,173 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n,m,p,q = map(int,input().split())
    twice = [x %13 for x in range(p,p+q)]
    cur = 1 #現在の月
    cnt = 0#経過した月
    while n>0:
        if cur in twice:
            n -=2*m
        else:
            n -=m
        cur+=1
        cur%=13
        if cur ==0:cur=1
        cnt+=1
    print(cnt)
main()
0