結果

問題 No.1486 ロボット
ユーザー lllllll88938494lllllll88938494
提出日時 2022-01-12 01:24:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 62,720 KB
最終ジャッジ日時 2024-04-26 21:18:30
合計ジャッジ時間 2,245 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,840 KB
testcase_01 AC 38 ms
52,096 KB
testcase_02 AC 36 ms
51,712 KB
testcase_03 AC 35 ms
52,096 KB
testcase_04 AC 36 ms
51,840 KB
testcase_05 AC 39 ms
52,224 KB
testcase_06 AC 39 ms
51,840 KB
testcase_07 AC 58 ms
60,160 KB
testcase_08 AC 37 ms
51,584 KB
testcase_09 AC 47 ms
58,752 KB
testcase_10 AC 65 ms
62,720 KB
testcase_11 AC 64 ms
62,720 KB
testcase_12 AC 59 ms
62,208 KB
testcase_13 AC 47 ms
58,752 KB
testcase_14 AC 57 ms
61,952 KB
testcase_15 AC 55 ms
62,080 KB
testcase_16 AC 54 ms
61,440 KB
testcase_17 AC 55 ms
62,720 KB
testcase_18 AC 56 ms
62,080 KB
testcase_19 AC 55 ms
62,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c,d,e = map(int,input().split())
lim = (a+b)*(c+d)
x = a+b
y = c+d
cnt=0

if e <= lim:
    for i in range(1,e+1):
        if 1 <= i%x <= a and 1 <= i%y <= c:
            cnt+=1
    print(cnt)

else:
    for i in range(1,lim+1):
        if 1 <= i%x <= a and 1 <= i%y <= c:
            cnt+=1
    div,mod=divmod(e,lim)
    cnt = div*cnt
    
    for i in range(1,mod+1):
        if 1 <= i%x <= a and 1 <= i%y <= c:
            cnt+=1
    
    print(cnt)
0