結果
| 問題 | No.538 N.G.S. |
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2017-06-30 23:06:57 |
| 言語 | Haskell (9.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 410 bytes |
| 記録 | |
| コンパイル時間 | 7,082 ms |
| コンパイル使用メモリ | 196,352 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-04-20 14:19:58 |
| 合計ジャッジ時間 | 8,547 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 50 RE * 1 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.Ratio
(%%) :: Integral a => Ratio a -> Ratio a -> Ratio a
n %% d = (numerator n * denominator d) % (denominator n * numerator d)
main :: IO ()
main = do
bs <- map read . words <$> getLine
print $ solve bs
solve :: [Integer] -> Integer
solve [b1, b2, b3] = numerator $ r * toRational b3 + d
where d = (b1 * b3 - b2 ^ 2) % (b1 - b2)
r = -(d - toRational b2) %% toRational b1
くれちー