結果

問題 No.167 N^M mod 10
ユーザー flippergoflippergo
提出日時 2021-01-01 17:06:09
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 220 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 67,268 KB
最終ジャッジ日時 2024-04-19 19:55:12
合計ジャッジ時間 2,086 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,440 KB
testcase_01 AC 33 ms
52,236 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 32 ms
52,704 KB
testcase_06 AC 33 ms
52,400 KB
testcase_07 AC 32 ms
53,164 KB
testcase_08 AC 34 ms
53,284 KB
testcase_09 AC 32 ms
53,624 KB
testcase_10 AC 32 ms
53,164 KB
testcase_11 AC 32 ms
52,944 KB
testcase_12 AC 32 ms
52,008 KB
testcase_13 AC 31 ms
52,876 KB
testcase_14 WA -
testcase_15 AC 33 ms
53,680 KB
testcase_16 AC 32 ms
52,064 KB
testcase_17 AC 32 ms
52,920 KB
testcase_18 AC 34 ms
53,280 KB
testcase_19 AC 32 ms
52,364 KB
testcase_20 AC 33 ms
52,524 KB
testcase_21 AC 33 ms
53,080 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input().strip()
M = input().strip()
n = int(N[-1])
k = 1
x = (n**2)%10
k = 2
while x!=n:
    k += 1
    x = (x*n)%10
T = k-1
m = int(M)%T
if m==0:
    m = T
k = 1
x = n
while k<m:
    x = (x*n)%10
    k += 1
print(x)
0