結果
問題 | No.167 N^M mod 10 |
ユーザー |
![]() |
提出日時 | 2017-07-07 04:26:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 436 bytes |
コンパイル時間 | 76 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-22 01:42:39 |
合計ジャッジ時間 | 1,704 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 RE * 10 |
ソースコード
#167 N^Mmod10N=int(input())M=int(input())a=1N%=10c=0T=[0]*10S=[-1]*10while M>0 and T[a]<2:a*=Na%=10M-=1T[a]+=1if S[a]==-1:S[a]=cc+=1# print (a)#rint (M)if M==0:print(a)else:M+=c-S[a]# print (M)M%=c-S[a]-1# print (M)if M==0:M+=c-S[a]-1a=1# print (M)while M>0:a*=Na%=10M-=1# print (a)print (a)