結果

問題 No.1161 Many Powers
ユーザー brthyyjpbrthyyjp
提出日時 2021-02-05 14:53:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 185 bytes
コンパイル時間 1,267 ms
コンパイル使用メモリ 86,652 KB
実行使用メモリ 76,144 KB
最終ジャッジ日時 2023-09-14 23:16:13
合計ジャッジ時間 5,907 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,000 KB
testcase_01 AC 72 ms
71,372 KB
testcase_02 AC 72 ms
71,304 KB
testcase_03 AC 74 ms
70,988 KB
testcase_04 AC 72 ms
71,236 KB
testcase_05 AC 85 ms
75,864 KB
testcase_06 AC 81 ms
75,788 KB
testcase_07 AC 73 ms
71,292 KB
testcase_08 AC 114 ms
76,032 KB
testcase_09 AC 118 ms
75,904 KB
testcase_10 AC 99 ms
75,968 KB
testcase_11 AC 111 ms
76,064 KB
testcase_12 AC 95 ms
76,048 KB
testcase_13 AC 130 ms
75,940 KB
testcase_14 AC 151 ms
76,004 KB
testcase_15 AC 146 ms
76,144 KB
testcase_16 AC 161 ms
76,064 KB
testcase_17 AC 133 ms
76,116 KB
testcase_18 AC 117 ms
75,760 KB
testcase_19 AC 102 ms
75,636 KB
testcase_20 AC 163 ms
76,064 KB
testcase_21 AC 104 ms
75,980 KB
testcase_22 AC 157 ms
75,936 KB
testcase_23 AC 72 ms
71,124 KB
testcase_24 AC 72 ms
71,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(int, input().split())
q, r = divmod(a, c)
ans = 0
for i in range(c):
    if i <= r:
        ans += pow(i, b, c)*(q+1)
    else:
        ans += pow(i, b, c)*q
print(ans%c)
0