結果

問題 No.846 メダル
ユーザー clearbookclearbook
提出日時 2019-12-11 17:48:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 473 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 15,092 KB
最終ジャッジ日時 2023-09-06 13:07:17
合計ジャッジ時間 4,093 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,260 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 15 ms
7,768 KB
testcase_03 AC 15 ms
7,768 KB
testcase_04 AC 15 ms
7,836 KB
testcase_05 AC 16 ms
7,836 KB
testcase_06 AC 16 ms
7,824 KB
testcase_07 AC 15 ms
7,764 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 #

P, Q, R = map(int, input().split())
A, B, C = map(int, input().split())

min_N = 10**18
max_N = 0
flag = False
for i in range(P*(A-1), P*A+1):
    gold = (i-1) // P + 1
    silver = (i-1) // Q + 1 - gold
    copper = (i-1) // R + 1 - gold - silver
    if gold == A and silver == B and copper == C:
        flag = True
        if i < min_N:
            min_N = i
        elif i > max_N:
            max_N = i
            
if flag:
    print(min_N, max_N)
else:
    print(-1)
0