結果
問題 | No.747 循環小数N桁目 Hard |
ユーザー | ducktail |
提出日時 | 2018-10-19 23:03:36 |
言語 | Haskell (9.8.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 402 bytes |
コンパイル時間 | 9,085 ms |
コンパイル使用メモリ | 171,776 KB |
実行使用メモリ | 27,808 KB |
最終ジャッジ日時 | 2024-11-18 22:17:46 |
合計ジャッジ時間 | 104,338 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
13,636 KB |
testcase_01 | AC | 2 ms
26,660 KB |
testcase_02 | AC | 2 ms
13,632 KB |
testcase_03 | AC | 2 ms
13,764 KB |
testcase_04 | AC | 2 ms
13,632 KB |
testcase_05 | AC | 2 ms
25,632 KB |
testcase_06 | AC | 1 ms
13,764 KB |
testcase_07 | AC | 2 ms
13,636 KB |
testcase_08 | AC | 2 ms
13,640 KB |
testcase_09 | AC | 2 ms
27,808 KB |
testcase_10 | AC | 2 ms
23,748 KB |
testcase_11 | AC | 2 ms
13,640 KB |
testcase_12 | AC | 1 ms
13,636 KB |
testcase_13 | AC | 2 ms
13,768 KB |
testcase_14 | AC | 2 ms
13,632 KB |
testcase_15 | AC | 2 ms
23,588 KB |
testcase_16 | AC | 2 ms
13,636 KB |
testcase_17 | AC | 2 ms
25,796 KB |
testcase_18 | AC | 2 ms
13,636 KB |
testcase_19 | AC | 2 ms
6,820 KB |
testcase_20 | AC | 2 ms
6,820 KB |
testcase_21 | AC | 1 ms
6,816 KB |
testcase_22 | AC | 2 ms
6,820 KB |
testcase_23 | AC | 2 ms
6,816 KB |
testcase_24 | AC | 2 ms
6,820 KB |
testcase_25 | AC | 2 ms
6,820 KB |
testcase_26 | AC | 2 ms
6,816 KB |
testcase_27 | AC | 2 ms
6,816 KB |
testcase_28 | AC | 1 ms
6,816 KB |
testcase_29 | AC | 2 ms
6,820 KB |
testcase_30 | AC | 1 ms
6,816 KB |
testcase_31 | AC | 2 ms
6,816 KB |
testcase_32 | AC | 1 ms
6,816 KB |
testcase_33 | AC | 1,004 ms
19,200 KB |
testcase_34 | AC | 147 ms
17,140 KB |
testcase_35 | AC | 24 ms
9,216 KB |
testcase_36 | AC | 27 ms
10,368 KB |
testcase_37 | AC | 20 ms
8,576 KB |
testcase_38 | AC | 233 ms
18,048 KB |
testcase_39 | AC | 289 ms
17,024 KB |
testcase_40 | AC | 1,260 ms
19,072 KB |
testcase_41 | AC | 963 ms
19,072 KB |
testcase_42 | AC | 534 ms
19,072 KB |
testcase_43 | AC | 159 ms
17,280 KB |
testcase_44 | AC | 406 ms
18,068 KB |
testcase_45 | AC | 927 ms
18,732 KB |
testcase_46 | AC | 304 ms
18,048 KB |
testcase_47 | AC | 916 ms
19,200 KB |
testcase_48 | AC | 618 ms
18,048 KB |
testcase_49 | AC | 286 ms
18,304 KB |
testcase_50 | AC | 552 ms
18,048 KB |
testcase_51 | AC | 63 ms
14,804 KB |
testcase_52 | AC | 55 ms
14,080 KB |
testcase_53 | TLE | - |
testcase_54 | TLE | - |
testcase_55 | TLE | - |
testcase_56 | TLE | - |
testcase_57 | AC | 140 ms
17,120 KB |
testcase_58 | TLE | - |
testcase_59 | AC | 451 ms
18,176 KB |
testcase_60 | TLE | - |
testcase_61 | AC | 56 ms
12,672 KB |
testcase_62 | TLE | - |
testcase_63 | AC | 1,133 ms
19,200 KB |
testcase_64 | AC | 62 ms
14,692 KB |
testcase_65 | AC | 26 ms
8,192 KB |
testcase_66 | AC | 261 ms
18,084 KB |
testcase_67 | AC | 30 ms
10,368 KB |
testcase_68 | AC | 866 ms
19,092 KB |
testcase_69 | AC | 415 ms
19,200 KB |
testcase_70 | AC | 418 ms
16,912 KB |
testcase_71 | AC | 59 ms
14,060 KB |
testcase_72 | AC | 859 ms
18,152 KB |
testcase_73 | AC | 672 ms
19,200 KB |
testcase_74 | AC | 268 ms
18,304 KB |
testcase_75 | AC | 83 ms
18,136 KB |
testcase_76 | AC | 403 ms
17,808 KB |
testcase_77 | AC | 178 ms
18,176 KB |
testcase_78 | AC | 785 ms
19,100 KB |
testcase_79 | AC | 97 ms
18,196 KB |
testcase_80 | AC | 596 ms
19,200 KB |
testcase_81 | AC | 152 ms
17,036 KB |
testcase_82 | AC | 789 ms
18,072 KB |
testcase_83 | AC | 138 ms
16,976 KB |
testcase_84 | AC | 757 ms
19,072 KB |
testcase_85 | AC | 835 ms
19,072 KB |
testcase_86 | AC | 596 ms
18,072 KB |
testcase_87 | AC | 706 ms
19,072 KB |
testcase_88 | AC | 394 ms
18,068 KB |
testcase_89 | AC | 966 ms
18,340 KB |
testcase_90 | AC | 203 ms
18,180 KB |
testcase_91 | AC | 1,315 ms
19,200 KB |
testcase_92 | AC | 107 ms
18,040 KB |
testcase_93 | AC | 311 ms
18,176 KB |
testcase_94 | TLE | - |
testcase_95 | TLE | - |
testcase_96 | TLE | - |
testcase_97 | AC | 638 ms
20,224 KB |
testcase_98 | TLE | - |
testcase_99 | AC | 1,507 ms
20,608 KB |
testcase_100 | TLE | - |
testcase_101 | TLE | - |
testcase_102 | AC | 253 ms
18,304 KB |
testcase_103 | AC | 1,337 ms
19,712 KB |
testcase_104 | AC | 1,335 ms
19,712 KB |
testcase_105 | AC | 1,347 ms
19,840 KB |
testcase_106 | AC | 1,337 ms
19,840 KB |
testcase_107 | AC | 1,344 ms
19,712 KB |
testcase_108 | AC | 1,338 ms
19,584 KB |
testcase_109 | AC | 1,335 ms
19,712 KB |
testcase_110 | AC | 1,335 ms
19,712 KB |
testcase_111 | AC | 1,346 ms
19,584 KB |
testcase_112 | AC | 1,339 ms
20,388 KB |
testcase_113 | AC | 1,346 ms
19,712 KB |
testcase_114 | AC | 1,330 ms
20,388 KB |
testcase_115 | AC | 1,330 ms
19,584 KB |
testcase_116 | AC | 1,327 ms
19,712 KB |
testcase_117 | AC | 1,344 ms
19,840 KB |
testcase_118 | AC | 1,330 ms
19,712 KB |
testcase_119 | AC | 1,336 ms
19,840 KB |
testcase_120 | AC | 1,336 ms
19,584 KB |
testcase_121 | AC | 1,333 ms
19,584 KB |
testcase_122 | AC | 1,339 ms
20,260 KB |
testcase_123 | AC | 1,294 ms
26,016 KB |
コンパイルメッセージ
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
ソースコード
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