結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,020 KB
testcase_01 AC 78 ms
15,040 KB
testcase_02 AC 77 ms
15,028 KB
testcase_03 AC 82 ms
15,240 KB
testcase_04 AC 77 ms
15,328 KB
testcase_05 AC 78 ms
15,032 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 78 ms
15,124 KB
testcase_09 WA -
testcase_10 AC 79 ms
15,076 KB
testcase_11 WA -
testcase_12 AC 80 ms
15,052 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 79 ms
15,116 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 77 ms
15,212 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 77 ms
15,292 KB
testcase_24 AC 77 ms
15,232 KB
testcase_25 WA -
testcase_26 AC 77 ms
15,236 KB
testcase_27 AC 77 ms
15,124 KB
testcase_28 AC 77 ms
15,316 KB
testcase_29 AC 77 ms
15,084 KB
testcase_30 AC 76 ms
15,312 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 85 ms
15,888 KB
testcase_34 WA -
testcase_35 AC 87 ms
15,332 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 88 ms
15,756 KB
testcase_41 WA -
testcase_42 AC 89 ms
15,972 KB
testcase_43 WA -
testcase_44 AC 88 ms
15,724 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 AC 85 ms
15,344 KB
testcase_49 AC 89 ms
15,920 KB
testcase_50 AC 81 ms
15,304 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 81 ms
15,548 KB
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 98 ms
16,328 KB
testcase_59 AC 89 ms
15,832 KB
testcase_60 AC 87 ms
15,540 KB
testcase_61 WA -
testcase_62 AC 82 ms
15,656 KB
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 88 ms
16,096 KB
testcase_70 AC 80 ms
15,256 KB
testcase_71 AC 82 ms
15,376 KB
testcase_72 WA -
testcase_73 WA -
testcase_74 WA -
testcase_75 WA -
testcase_76 WA -
testcase_77 AC 87 ms
15,536 KB
testcase_78 WA -
testcase_79 AC 91 ms
15,884 KB
testcase_80 AC 87 ms
15,940 KB
testcase_81 WA -
testcase_82 WA -
testcase_83 AC 83 ms
15,584 KB
testcase_84 WA -
testcase_85 WA -
testcase_86 WA -
testcase_87 WA -
testcase_88 WA -
testcase_89 AC 83 ms
15,264 KB
testcase_90 WA -
testcase_91 WA -
testcase_92 WA -
testcase_93 WA -
testcase_94 WA -
testcase_95 AC 83 ms
15,716 KB
testcase_96 AC 85 ms
15,528 KB
testcase_97 AC 99 ms
16,492 KB
testcase_98 AC 100 ms
16,432 KB
testcase_99 WA -
testcase_100 AC 93 ms
16,072 KB
testcase_101 WA -
testcase_102 WA -
testcase_103 AC 90 ms
15,904 KB
testcase_104 WA -
testcase_105 WA -
testcase_106 AC 93 ms
15,808 KB
testcase_107 AC 93 ms
15,840 KB
testcase_108 AC 92 ms
16,040 KB
testcase_109 WA -
testcase_110 AC 93 ms
16,148 KB
testcase_111 AC 90 ms
15,792 KB
testcase_112 AC 92 ms
15,988 KB
testcase_113 WA -
testcase_114 WA -
testcase_115 WA -
testcase_116 WA -
testcase_117 AC 92 ms
15,920 KB
testcase_118 AC 91 ms
15,720 KB
testcase_119 WA -
testcase_120 WA -
testcase_121 AC 94 ms
15,732 KB
testcase_122 AC 92 ms
15,808 KB
testcase_123 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp
k = gets.chomp

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 = 3*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