結果

問題 No.16 累乗の加算
ユーザー 👑 colognecologne
提出日時 2022-01-21 13:20:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 205 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,968 KB
実行使用メモリ 53,932 KB
最終ジャッジ日時 2024-05-04 02:03:30
合計ジャッジ時間 1,227 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,456 KB
testcase_01 AC 31 ms
52,164 KB
testcase_02 AC 31 ms
53,220 KB
testcase_03 AC 32 ms
52,000 KB
testcase_04 AC 32 ms
51,940 KB
testcase_05 AC 31 ms
53,160 KB
testcase_06 AC 32 ms
53,932 KB
testcase_07 AC 31 ms
52,684 KB
testcase_08 AC 33 ms
53,044 KB
testcase_09 AC 34 ms
51,868 KB
testcase_10 AC 33 ms
53,504 KB
testcase_11 AC 32 ms
52,532 KB
testcase_12 AC 34 ms
52,676 KB
testcase_13 AC 31 ms
53,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline

def main():
    x, N = map(int, input().split())
    M = 1000003
    print(sum(pow(x, int(a), M) for a in input().split())%M)

if __name__ == '__main__':
    main()
0