結果
問題 | No.747 循環小数N桁目 Hard |
ユーザー |
|
提出日時 | 2018-11-11 22:29:07 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 517 bytes |
コンパイル時間 | 1,795 ms |
コンパイル使用メモリ | 173,184 KB |
実行使用メモリ | 13,568 KB |
最終ジャッジ日時 | 2024-12-15 05:44:34 |
合計ジャッジ時間 | 5,050 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 120 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
importData.CharimportDebug.Tracemain = don <- getLinek <- getLineletr = [2,8,5,7,1,4]n' = modBigInteger n 6a = case n' of0 -> 61 -> 12 -> [4,2] !! (modBigInteger k 2)3 -> 34 -> 45 -> [1,5] !! (modBigInteger k 2)trace (show a) $ return ()print $ r !! ((a+5)`mod`6)modBigInteger::String->Int->IntmodBigInteger [] _ = 0modBigInteger xs m = foldl (\x y -> (x*10 + y) `mod` m) 0 (map digitToInt xs)