結果

問題 No.2193 メガの下1桁
ユーザー googol_S0googol_S0
提出日時 2023-01-13 21:26:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 89,844 KB
最終ジャッジ日時 2023-08-26 02:57:46
合計ジャッジ時間 6,386 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
89,500 KB
testcase_01 AC 109 ms
89,592 KB
testcase_02 AC 112 ms
89,628 KB
testcase_03 AC 110 ms
89,596 KB
testcase_04 AC 110 ms
89,548 KB
testcase_05 AC 110 ms
89,808 KB
testcase_06 AC 109 ms
89,532 KB
testcase_07 AC 109 ms
89,596 KB
testcase_08 AC 108 ms
89,572 KB
testcase_09 AC 110 ms
89,500 KB
testcase_10 AC 110 ms
89,728 KB
testcase_11 AC 108 ms
89,844 KB
testcase_12 AC 108 ms
89,404 KB
testcase_13 AC 109 ms
89,540 KB
testcase_14 AC 107 ms
89,780 KB
testcase_15 AC 108 ms
89,372 KB
testcase_16 AC 109 ms
89,476 KB
testcase_17 AC 109 ms
89,348 KB
testcase_18 AC 110 ms
89,820 KB
testcase_19 AC 107 ms
89,628 KB
testcase_20 AC 109 ms
89,456 KB
testcase_21 AC 110 ms
89,376 KB
testcase_22 AC 113 ms
89,532 KB
testcase_23 AC 110 ms
89,612 KB
testcase_24 AC 108 ms
89,536 KB
testcase_25 AC 109 ms
89,504 KB
testcase_26 AC 108 ms
89,588 KB
testcase_27 AC 109 ms
89,624 KB
testcase_28 AC 111 ms
89,348 KB
testcase_29 AC 110 ms
89,620 KB
testcase_30 AC 108 ms
89,476 KB
testcase_31 AC 108 ms
89,548 KB
testcase_32 AC 108 ms
89,372 KB
testcase_33 AC 110 ms
89,616 KB
testcase_34 AC 109 ms
89,488 KB
testcase_35 AC 110 ms
89,756 KB
testcase_36 AC 112 ms
89,448 KB
testcase_37 AC 113 ms
89,508 KB
testcase_38 AC 111 ms
89,492 KB
testcase_39 AC 107 ms
89,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=int(input())
D=int(input())
N=int(input())
B=int(input())
mod=27720
L=62
X=[[0]*mod for i in range(L+1)]
def f(x):
  return pow(x+D,x,mod)

for i in range(mod):
  X[0][i]=f(i)
for i in range(L):
  for j in range(mod):
    X[i+1][j]=X[i][X[i][j]]
ANS=M%mod
for i in range(L+1):
  if (N>>i)&1:
    ANS=X[i][ANS]
ANS%=B
if ANS==10:
  ANS='A'
print(ANS)
0