結果
問題 | No.740 幻の木 |
ユーザー |
![]() |
提出日時 | 2020-08-30 02:19:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 81,972 KB |
実行使用メモリ | 60,112 KB |
最終ジャッジ日時 | 2024-11-14 17:50:01 |
合計ジャッジ時間 | 1,272 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, M, P, Q = getlist() L = [0] * 12 for i in range(P - 1, P - 1 + Q): L[i] = 1 # print(L) cnt = 0 while True: if L[cnt % 12] == 1: N -= 2 * M else: N -= M if N <= 0: print(cnt + 1) return cnt += 1 if __name__ == '__main__': main()