結果

問題 No.167 N^M mod 10
ユーザー brthyyjpbrthyyjp
提出日時 2021-03-01 04:17:15
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 212 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 66,504 KB
最終ジャッジ日時 2024-04-14 03:32:05
合計ジャッジ時間 3,179 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,572 KB
testcase_01 AC 38 ms
52,308 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 38 ms
53,224 KB
testcase_06 AC 38 ms
52,180 KB
testcase_07 AC 37 ms
51,944 KB
testcase_08 AC 38 ms
51,824 KB
testcase_09 AC 42 ms
53,152 KB
testcase_10 AC 39 ms
52,004 KB
testcase_11 AC 41 ms
52,256 KB
testcase_12 AC 40 ms
53,160 KB
testcase_13 AC 39 ms
52,572 KB
testcase_14 AC 39 ms
53,664 KB
testcase_15 AC 38 ms
52,900 KB
testcase_16 AC 40 ms
53,292 KB
testcase_17 AC 39 ms
52,484 KB
testcase_18 AC 43 ms
52,860 KB
testcase_19 AC 39 ms
53,756 KB
testcase_20 AC 38 ms
51,824 KB
testcase_21 AC 38 ms
52,320 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = int(input())

n %= 10
X = [[0]*5 for i in range(10)]
for i in range(10):
    for j in range(5):
        X[i][j] = (i**j)%10
#print(X)
if m == 0:
    print(1)
else:
    print(X[n][(m-1)%4+1])
0