結果

問題 No.1161 Many Powers
ユーザー AEnAEn
提出日時 2022-05-13 14:45:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 1,192 ms
コンパイル使用メモリ 86,784 KB
実行使用メモリ 76,984 KB
最終ジャッジ日時 2023-09-28 18:48:50
合計ジャッジ時間 4,676 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,328 KB
testcase_01 AC 77 ms
71,088 KB
testcase_02 AC 76 ms
71,320 KB
testcase_03 AC 77 ms
71,392 KB
testcase_04 AC 77 ms
71,288 KB
testcase_05 AC 88 ms
75,996 KB
testcase_06 AC 86 ms
76,064 KB
testcase_07 AC 77 ms
71,084 KB
testcase_08 AC 120 ms
76,504 KB
testcase_09 AC 122 ms
76,536 KB
testcase_10 AC 100 ms
76,136 KB
testcase_11 AC 113 ms
76,312 KB
testcase_12 AC 99 ms
76,036 KB
testcase_13 AC 134 ms
76,516 KB
testcase_14 AC 157 ms
76,904 KB
testcase_15 AC 151 ms
76,296 KB
testcase_16 AC 167 ms
76,704 KB
testcase_17 AC 138 ms
76,624 KB
testcase_18 AC 123 ms
76,324 KB
testcase_19 AC 104 ms
76,184 KB
testcase_20 AC 167 ms
76,984 KB
testcase_21 AC 107 ms
76,368 KB
testcase_22 AC 165 ms
76,924 KB
testcase_23 AC 77 ms
71,048 KB
testcase_24 AC 75 ms
71,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, C = map(int, input().split())
num = [0]*C
a, b = A//C, A%C
for i in range(C):
    if i == 0 or i>b:
        num[i] = a
    else:
        num[i] = a+1
res = 0
for i in range(C):
    res += num[i]*pow(i, B, C)
    res %= C
print(res)
0