結果
問題 |
No.846 メダル
|
ユーザー |
![]() |
提出日時 | 2020-08-01 01:52:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 357 bytes |
コンパイル時間 | 377 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,696 KB |
最終ジャッジ日時 | 2024-07-07 00:32:08 |
合計ジャッジ時間 | 4,339 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 8 TLE * 1 -- * 13 |
ソースコード
P, Q, R = map(int, input().split()) A, B, C = map(int, input().split()) x = float('inf') y = -1 for N in range((A - 1) * P + 1, A * P + 1): a = (N + P - 1) // P b = (N + Q - 1) // Q - a c = (N + R - 1) // R - a - b if A == a and B == b and C == c: x = min(x, N) y = max(y, N) if y == -1: print(-1) else: print(x, y)