結果

問題 No.1161 Many Powers
ユーザー 👑 KazunKazun
提出日時 2020-11-28 14:34:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 138 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 76,968 KB
最終ジャッジ日時 2023-10-10 00:00:00
合計ジャッジ時間 3,953 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,208 KB
testcase_01 AC 75 ms
71,192 KB
testcase_02 AC 72 ms
71,464 KB
testcase_03 AC 71 ms
71,336 KB
testcase_04 AC 70 ms
71,324 KB
testcase_05 AC 78 ms
76,112 KB
testcase_06 AC 79 ms
76,096 KB
testcase_07 AC 72 ms
71,564 KB
testcase_08 AC 108 ms
76,372 KB
testcase_09 AC 111 ms
76,604 KB
testcase_10 AC 92 ms
76,008 KB
testcase_11 AC 105 ms
76,356 KB
testcase_12 AC 89 ms
75,896 KB
testcase_13 AC 125 ms
76,308 KB
testcase_14 AC 148 ms
76,740 KB
testcase_15 AC 141 ms
76,528 KB
testcase_16 AC 154 ms
76,652 KB
testcase_17 AC 128 ms
76,584 KB
testcase_18 AC 113 ms
76,332 KB
testcase_19 AC 96 ms
76,416 KB
testcase_20 AC 155 ms
76,968 KB
testcase_21 AC 99 ms
76,308 KB
testcase_22 AC 156 ms
76,728 KB
testcase_23 AC 69 ms
71,248 KB
testcase_24 AC 71 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,C=map(int,input().split())
X=[0]*(C+1)

for i in range(1,C+1):
    X[i]=(X[i-1]+pow(i,B,C))%C

Q,R=divmod(A,C)
print((Q*X[-1]+X[R])%C)
0