結果

問題 No.167 N^M mod 10
ユーザー mmmpppmmmppp
提出日時 2017-03-04 19:05:17
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 133 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,372 KB
実行使用メモリ 15,684 KB
最終ジャッジ日時 2023-09-05 05:33:39
合計ジャッジ時間 3,755 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,344 KB
testcase_01 WA -
testcase_02 AC 84 ms
15,584 KB
testcase_03 AC 83 ms
15,564 KB
testcase_04 WA -
testcase_05 AC 87 ms
15,108 KB
testcase_06 WA -
testcase_07 AC 82 ms
15,244 KB
testcase_08 AC 84 ms
15,308 KB
testcase_09 WA -
testcase_10 AC 82 ms
15,168 KB
testcase_11 AC 83 ms
15,132 KB
testcase_12 AC 82 ms
14,996 KB
testcase_13 AC 84 ms
15,292 KB
testcase_14 AC 85 ms
15,236 KB
testcase_15 AC 84 ms
15,280 KB
testcase_16 AC 81 ms
15,032 KB
testcase_17 AC 82 ms
15,168 KB
testcase_18 AC 82 ms
15,228 KB
testcase_19 AC 82 ms
15,032 KB
testcase_20 AC 81 ms
15,068 KB
testcase_21 WA -
testcase_22 AC 84 ms
15,588 KB
testcase_23 AC 84 ms
15,408 KB
testcase_24 AC 83 ms
15,684 KB
testcase_25 AC 83 ms
15,512 KB
testcase_26 AC 82 ms
15,496 KB
testcase_27 AC 82 ms
15,576 KB
testcase_28 AC 81 ms
15,428 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a,b=$<.map &:to_i
d=a%10
p (b<1?-1:d<2?[d]*4:d<3?[6,2,4,8]:d<4?[1,3,9,7]:d<5?[6,4]*2:d<7?d: d<8?[1,7,9,3]:d<9?[6,8,4,2]:[1,9]*2)[b%4]
0