結果
| 問題 |
No.846 メダル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-09 13:57:00 |
| 言語 | Scheme (Gauche-0.9.15) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 524 bytes |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 7,076 KB |
| 実行使用メモリ | 16,128 KB |
| 最終ジャッジ日時 | 2024-10-07 01:29:45 |
| 合計ジャッジ時間 | 1,870 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
(define (solve p q r a b c)
(let ([gh (* p a)]
[gl (+ 1 (* p (- a 1)))]
[sh (* q (+ a b))]
[sl (+ 1 (* q (+ a b -1)))]
[ch (* r (+ a b c))]
[cl (+ 1 (* r (+ a b c -1)))])
(let ([h (min gh sh ch)]
[l (max gl sl cl)])
(cond [(< h l) -1]
[else (format #f "~a ~a" l h)]))))
(define (main args)
(let* ([p (read)]
[q (read)]
[r (read)]
[a (read)]
[b (read)]
[c (read)])
(print (solve p q r a b c)))
0)