結果

問題 No.846 メダル
ユーザー O2MTO2MT
提出日時 2020-09-23 18:51:37
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 428 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 71,316 KB
最終ジャッジ日時 2023-09-10 08:51:06
合計ジャッジ時間 6,673 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,316 KB
testcase_01 AC 69 ms
71,224 KB
testcase_02 AC 70 ms
71,168 KB
testcase_03 AC 71 ms
71,288 KB
testcase_04 AC 71 ms
71,112 KB
testcase_05 AC 69 ms
71,264 KB
testcase_06 AC 69 ms
70,932 KB
testcase_07 AC 70 ms
71,084 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import ceil
P,Q,R = map(int,input().split())
A,B,C = map(int,input().split())

N1,N2 = P*(A-1),P*A
mi,ma = -1,-1
for n in range(N1,N2+1):
    if A == ceil(n/P) and B == ceil(n/Q)-A and C == ceil(n/R)-A-B:
        mi = n
        break
for n in range(N2,N1-1,-1):
   if A == ceil(n/P) and B == ceil(n/Q)-A and C == ceil(n/R)-A-B:
        ma = n
        break
if mi == -1 or ma == -1:
    print(-1)
else:
    print(mi,ma)
0