結果

問題 No.747 循環小数N桁目 Hard
ユーザー simansiman
提出日時 2022-07-15 08:55:45
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 196 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 97,760 KB
最終ジャッジ日時 2023-09-09 10:23:01
合計ジャッジ時間 30,263 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
19,676 KB
testcase_01 AC 84 ms
15,404 KB
testcase_02 AC 84 ms
15,428 KB
testcase_03 AC 83 ms
15,304 KB
testcase_04 AC 84 ms
15,424 KB
testcase_05 AC 84 ms
15,312 KB
testcase_06 AC 85 ms
15,404 KB
testcase_07 AC 85 ms
15,384 KB
testcase_08 AC 86 ms
15,428 KB
testcase_09 AC 85 ms
15,348 KB
testcase_10 AC 85 ms
15,540 KB
testcase_11 AC 85 ms
15,296 KB
testcase_12 AC 86 ms
15,520 KB
testcase_13 AC 87 ms
15,404 KB
testcase_14 AC 84 ms
15,332 KB
testcase_15 AC 85 ms
15,492 KB
testcase_16 AC 85 ms
15,400 KB
testcase_17 AC 85 ms
15,424 KB
testcase_18 AC 84 ms
15,444 KB
testcase_19 AC 84 ms
15,500 KB
testcase_20 AC 85 ms
15,568 KB
testcase_21 AC 84 ms
15,568 KB
testcase_22 AC 84 ms
15,500 KB
testcase_23 AC 84 ms
15,524 KB
testcase_24 AC 85 ms
15,292 KB
testcase_25 AC 85 ms
15,468 KB
testcase_26 AC 85 ms
15,400 KB
testcase_27 AC 84 ms
15,484 KB
testcase_28 AC 85 ms
15,568 KB
testcase_29 AC 89 ms
15,516 KB
testcase_30 AC 90 ms
15,432 KB
testcase_31 AC 85 ms
15,480 KB
testcase_32 AC 84 ms
15,292 KB
testcase_33 AC 1,770 ms
46,648 KB
testcase_34 AC 375 ms
29,920 KB
testcase_35 AC 262 ms
38,912 KB
testcase_36 AC 315 ms
49,560 KB
testcase_37 AC 141 ms
24,424 KB
testcase_38 AC 788 ms
43,796 KB
testcase_39 AC 421 ms
26,720 KB
testcase_40 TLE -
testcase_41 TLE -
testcase_42 AC 1,927 ms
63,268 KB
testcase_43 AC 632 ms
42,460 KB
testcase_44 AC 1,428 ms
55,604 KB
testcase_45 AC 1,533 ms
43,424 KB
testcase_46 AC 1,399 ms
61,840 KB
testcase_47 AC 1,746 ms
47,652 KB
testcase_48 AC 533 ms
25,636 KB
testcase_49 AC 1,176 ms
54,964 KB
testcase_50 AC 316 ms
20,724 KB
testcase_51 AC 510 ms
52,924 KB
testcase_52 AC 299 ms
33,756 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 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
K = gets.chomp
L = K.size

base = 1
d = 1

L.times do |i|
  k = K[-(i + 1)].to_i
  d *= N.pow(k * base, 6)
  d %= 6

  base *= 10
  base %= 6
end

pp [2, 8, 5, 7, 1, 4][(d - 1) % 6]
0