結果

問題 No.747 循環小数N桁目 Hard
ユーザー shi-moshi-mo
提出日時 2020-10-02 01:27:58
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 11,172 KB
実行使用メモリ 16,520 KB
最終ジャッジ日時 2023-09-21 19:51:39
合計ジャッジ時間 16,606 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,124 KB
testcase_01 AC 79 ms
15,128 KB
testcase_02 AC 79 ms
15,120 KB
testcase_03 AC 78 ms
15,312 KB
testcase_04 AC 78 ms
15,264 KB
testcase_05 AC 78 ms
15,260 KB
testcase_06 AC 77 ms
15,300 KB
testcase_07 AC 77 ms
15,244 KB
testcase_08 AC 77 ms
15,228 KB
testcase_09 WA -
testcase_10 AC 76 ms
15,124 KB
testcase_11 AC 77 ms
15,240 KB
testcase_12 AC 77 ms
15,220 KB
testcase_13 AC 76 ms
15,008 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 77 ms
15,284 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 76 ms
15,228 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 77 ms
15,216 KB
testcase_24 AC 76 ms
15,124 KB
testcase_25 WA -
testcase_26 AC 76 ms
15,284 KB
testcase_27 AC 77 ms
15,116 KB
testcase_28 AC 76 ms
15,100 KB
testcase_29 AC 78 ms
15,084 KB
testcase_30 AC 77 ms
15,096 KB
testcase_31 AC 77 ms
15,168 KB
testcase_32 WA -
testcase_33 AC 84 ms
15,504 KB
testcase_34 AC 80 ms
15,480 KB
testcase_35 AC 84 ms
15,484 KB
testcase_36 AC 87 ms
15,960 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 85 ms
15,536 KB
testcase_41 AC 89 ms
15,864 KB
testcase_42 AC 87 ms
15,936 KB
testcase_43 WA -
testcase_44 AC 85 ms
15,692 KB
testcase_45 AC 83 ms
15,488 KB
testcase_46 WA -
testcase_47 AC 91 ms
15,724 KB
testcase_48 AC 79 ms
15,340 KB
testcase_49 AC 87 ms
15,460 KB
testcase_50 AC 80 ms
15,156 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 81 ms
15,408 KB
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 95 ms
16,520 KB
testcase_59 AC 84 ms
15,668 KB
testcase_60 AC 82 ms
15,736 KB
testcase_61 AC 93 ms
16,208 KB
testcase_62 AC 81 ms
15,536 KB
testcase_63 AC 84 ms
15,748 KB
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 88 ms
15,832 KB
testcase_70 AC 78 ms
15,256 KB
testcase_71 AC 87 ms
15,348 KB
testcase_72 WA -
testcase_73 WA -
testcase_74 AC 94 ms
15,908 KB
testcase_75 WA -
testcase_76 WA -
testcase_77 AC 91 ms
15,380 KB
testcase_78 WA -
testcase_79 AC 97 ms
16,092 KB
testcase_80 AC 93 ms
15,684 KB
testcase_81 AC 90 ms
15,392 KB
testcase_82 WA -
testcase_83 AC 96 ms
15,292 KB
testcase_84 WA -
testcase_85 WA -
testcase_86 WA -
testcase_87 WA -
testcase_88 AC 129 ms
15,432 KB
testcase_89 AC 169 ms
15,052 KB
testcase_90 WA -
testcase_91 AC 171 ms
15,392 KB
testcase_92 AC 172 ms
15,920 KB
testcase_93 AC 96 ms
15,968 KB
testcase_94 AC 82 ms
15,492 KB
testcase_95 AC 82 ms
15,584 KB
testcase_96 AC 84 ms
15,540 KB
testcase_97 AC 97 ms
16,332 KB
testcase_98 AC 96 ms
16,496 KB
testcase_99 WA -
testcase_100 AC 90 ms
16,064 KB
testcase_101 WA -
testcase_102 AC 89 ms
15,976 KB
testcase_103 AC 89 ms
15,908 KB
testcase_104 AC 88 ms
15,816 KB
testcase_105 WA -
testcase_106 AC 90 ms
15,860 KB
testcase_107 AC 88 ms
15,792 KB
testcase_108 AC 88 ms
15,768 KB
testcase_109 WA -
testcase_110 AC 89 ms
15,792 KB
testcase_111 AC 89 ms
15,904 KB
testcase_112 AC 89 ms
16,128 KB
testcase_113 WA -
testcase_114 WA -
testcase_115 WA -
testcase_116 WA -
testcase_117 AC 88 ms
15,676 KB
testcase_118 AC 89 ms
15,908 KB
testcase_119 AC 89 ms
15,672 KB
testcase_120 WA -
testcase_121 AC 88 ms
15,924 KB
testcase_122 AC 89 ms
15,812 KB
testcase_123 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp
k = gets.chomp

MOD6 = [ [0, 4, 2], [3, 1, 5] ].freeze
def pow_mod6(n, k)
  k2 = k[-1].to_i % 2
  if k.length <= 1 && k[-1] <= '2'
    k2 = k.to_i
  end

  n2 = n[-1].to_i % 2
  n3 = n.each_char.map(&:to_i).sum % 3
  n6 = MOD6[n2][n3]
  if n.length <= 1 && n[-1] <= '6'
    n6 = n.to_i
  end
  n6.pow(k2, 6)
end

puts '428571'[pow_mod6(n, k)]
0