結果

問題 No.167 N^M mod 10
ユーザー MaxMellonMaxMellon
提出日時 2015-08-13 17:04:35
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 105 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 11,244 KB
実行使用メモリ 25,296 KB
最終ジャッジ日時 2023-09-25 11:27:27
合計ジャッジ時間 3,862 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,256 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 83 ms
15,888 KB
testcase_06 AC 82 ms
15,208 KB
testcase_07 AC 81 ms
15,392 KB
testcase_08 AC 81 ms
15,260 KB
testcase_09 AC 80 ms
15,200 KB
testcase_10 AC 80 ms
15,264 KB
testcase_11 AC 81 ms
15,280 KB
testcase_12 AC 82 ms
15,452 KB
testcase_13 AC 80 ms
15,304 KB
testcase_14 AC 80 ms
15,316 KB
testcase_15 AC 79 ms
15,352 KB
testcase_16 AC 80 ms
15,616 KB
testcase_17 AC 81 ms
15,144 KB
testcase_18 AC 312 ms
25,296 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 80 ms
15,784 KB
testcase_27 RE -
testcase_28 AC 80 ms
15,660 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'bigdecimal'
n = gets.chomp.to_i
m = gets.chomp.to_i
n %= 10
puts (BigDecimal(n ** m) % 10).to_i
0