結果
| 問題 | No.846 メダル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-23 18:51:37 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 663 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 132,864 KB |
| 最終ジャッジ日時 | 2026-03-16 07:39:19 |
| 合計ジャッジ時間 | 46,946 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 TLE * 1 |
| other | AC * 8 TLE * 14 |
ソースコード
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)