結果

問題 No.747 循環小数N桁目 Hard
ユーザー ducktailducktail
提出日時 2018-10-19 23:03:36
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 402 bytes
コンパイル時間 8,214 ms
コンパイル使用メモリ 171,392 KB
実行使用メモリ 25,344 KB
最終ジャッジ日時 2024-04-29 16:50:16
合計ジャッジ時間 21,722 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,752 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 998 ms
19,072 KB
testcase_34 AC 145 ms
17,012 KB
testcase_35 AC 23 ms
9,344 KB
testcase_36 AC 25 ms
10,368 KB
testcase_37 AC 19 ms
8,448 KB
testcase_38 AC 224 ms
18,176 KB
testcase_39 AC 285 ms
17,280 KB
testcase_40 AC 1,242 ms
19,072 KB
testcase_41 AC 940 ms
19,200 KB
testcase_42 AC 520 ms
19,072 KB
testcase_43 AC 155 ms
17,152 KB
testcase_44 AC 397 ms
18,192 KB
testcase_45 AC 921 ms
18,600 KB
testcase_46 AC 297 ms
18,176 KB
testcase_47 AC 894 ms
19,072 KB
testcase_48 AC 598 ms
18,048 KB
testcase_49 AC 283 ms
18,176 KB
testcase_50 AC 557 ms
18,048 KB
testcase_51 AC 62 ms
14,548 KB
testcase_52 AC 54 ms
13,824 KB
testcase_53 TLE -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
testcase_88 -- -
testcase_89 -- -
testcase_90 -- -
testcase_91 -- -
testcase_92 -- -
testcase_93 -- -
testcase_94 -- -
testcase_95 -- -
testcase_96 -- -
testcase_97 -- -
testcase_98 -- -
testcase_99 -- -
testcase_100 -- -
testcase_101 -- -
testcase_102 -- -
testcase_103 -- -
testcase_104 -- -
testcase_105 -- -
testcase_106 -- -
testcase_107 -- -
testcase_108 -- -
testcase_109 -- -
testcase_110 -- -
testcase_111 -- -
testcase_112 -- -
testcase_113 -- -
testcase_114 -- -
testcase_115 -- -
testcase_116 -- -
testcase_117 -- -
testcase_118 -- -
testcase_119 -- -
testcase_120 -- -
testcase_121 -- -
testcase_122 -- -
testcase_123 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

import Control.Applicative

main :: IO ()
main = solve <$> readLn <*> readLn >>= print

solve :: Integer -> Integer -> Int
solve n k = let r = f (n `mod` 6) k
                in if r == 0 then 4 else [2,8,5,7,1] !! (fromIntegral (r - 1))
  where
    f x y
      | y == 0 = 1
      | even y = let z = f x (y `div` 2) in z * z `mod` 6
      | otherwise = let z = f x ((y-1) `div` 2) in x * z * z `mod` 6
0