結果
問題 | No.604 誕生日のお小遣い |
ユーザー |
![]() |
提出日時 | 2017-12-04 01:56:34 |
言語 | Haskell (9.10.1) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,064 bytes |
コンパイル時間 | 1,242 ms |
コンパイル使用メモリ | 158,208 KB |
最終ジャッジ日時 | 2024-11-21 19:16:12 |
合計ジャッジ時間 | 1,650 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) Main.hs:37:24: error: [GHC-87543] Ambiguous occurrence ‘BC.getLine’. It could refer to either ‘BC.getLine’, imported qualified from ‘Data.ByteString’ at Main.hs:8:1-38, or ‘BC.getLine’, imported qualified from ‘Data.ByteString.Char8’ at Main.hs:7:1-44. | 37 | readInt = parseInt <$> BC.getLine | ^^^^^^^^^^ Main.hs:40:26: error: [GHC-87543] Ambiguous occurrence ‘BC.getLine’. It could refer to either ‘BC.getLine’, imported qualified from ‘Data.ByteString’ at Main.hs:8:1-38, or ‘BC.getLine’, imported qualified from ‘Data.ByteString.Char8’ at Main.hs:7:1-44. | 40 | readInts = parseInts <$> BC.getLine | ^^^^^^^^^^
ソースコード
moduleMainwhereimportControl.MonadimportControl.ApplicativeimportData.MaybeimportData.ListimportqualifiedText.PrintfimportqualifiedData.ByteString.CharasBCimportqualifiedData.ByteStringasBCimportDebug.Trace------------------------------------------lowerBound::Integer->Bool->Integer->Integer->IntegerlowerBound pred l r| l + 1 >= r = r| otherwise =let m = (l + r) `div` 2 inif pred m then lowerBound pred l m else lowerBound pred m rmain::IO()main = do[a, b, c] <- map fromIntegral <$> readIntslet f x = x + (x `div` a) * (b - 1)print $ lowerBound ((>= c) . f) 0 (10^18)------------------------------------------{- Int input -}parseInt::BCByteString->IntparseInt = fst . fromJust . BC.readIntparseInts::BCByteString->IntparseInts = map parseInt <$> BC.wordsreadInt::IOIntreadInt = parseInt <$> BC.getLinereadInts::IOIntreadInts = parseInts <$> BC.getLine{- Double Formatting -}doubleFmt::Double->StringdoubleFmt = Text.Printf.printf "%.12f"