Skip to content

Instantly share code, notes, and snippets.

@uchidama
Created July 5, 2021 16:39
Show Gist options
  • Save uchidama/d53a3228add0e57f763457c508f9a099 to your computer and use it in GitHub Desktop.
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
'''
[問題]
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