結果
| 問題 |
No.1486 ロボット
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-20 13:08:37 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 263 ms / 2,000 ms |
| コード長 | 1,052 bytes |
| コンパイル時間 | 100 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-10 07:14:11 |
| 合計ジャッジ時間 | 2,687 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
# coding utf-8
def Input_func():
data = input().split(" ")
return data
def Time_count_func(time, a, b, c, d):
section_time = 0
for t in range(time):
if t % (a + b) < a and t % (c + d) < c:
section_time += 1
return section_time
def Calc_func(data):
a = int(data[0])
b = int(data[1])
c = int(data[2])
d = int(data[3])
e = int(data[4])
section_time = 0
cycle_num = 0
dive_rem = 0
answer = 0
# cycle time
time = ((a + b) * (d + c))
# e < cycle time
if e < time:
time = e
answer = Time_count_func(time, a, b, c, d)
else:
cycle_num = e // time
dive_rem = e % time
section_time = Time_count_func(time, a, b, c, d)
if answer != 0:
print(answer)
else:
answer = section_time * cycle_num
answer += Time_count_func(dive_rem, a, b, c, d)
print(answer)
def main():
# data[0]~[4] is A~E
data = Input_func()
Calc_func(data)
if __name__ == '__main__':
main()