結果

問題 No.1486 ロボット
ユーザー sgsw
提出日時 2021-04-30 01:38:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 491 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-18 01:29:38
合計ジャッジ時間 3,716 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c,d,e = map(int,input().split())
M = (a  + b) * (c + d)
x = 0
for i in range(1,M + 1):
    if 0 <(i % (a + b)) <= a and 0 < (i % (c + d)) <= c:
        x += 1 
ans = x * (e // M)
e %= M 
for i in range(1,e + 1):
    if 0 <(i % (a + b)) <= a and 0 < (i % (c + d)) <= c:
        ans += 1 
print(ans)
0