Created
July 5, 2021 16:39
-
-
Save uchidama/d53a3228add0e57f763457c508f9a099 to your computer and use it in GitHub Desktop.
AtCoder Beginner Contest 123 [ C - Five Transportations ] https://atcoder.jp/contests/abc123/tasks/abc123_c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc123/tasks/abc123_c | |
[結果] | |
Python(3.8.2) AC 26ms | |
PyPy3(7.3.0) AC 69ms | |
''' | |
import sys | |
import math | |
sys.setrecursionlimit(10 ** 6) # 再帰上限の引き上げ | |
input = sys.stdin.readline | |
INF = 2 ** 63 - 1 | |
N = int(input()) | |
A = [] | |
for _ in range(5): | |
a = int(input()) | |
A.append(a) | |
# 処理能力が一番低い交通機関を出す | |
min_num = min(A) | |
# 人数/一番低い処理能力。ここが一番足をひっぱる。あとの4つの交通機関は、ここより大きいので流れる。ゆえに各1分で+4 | |
print(math.ceil(N/min_num) + 4) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment