結果

問題 No.1343 Dividing Digit
ユーザー chineristACchineristAC
提出日時 2021-01-16 13:04:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 159 bytes
コンパイル時間 1,995 ms
コンパイル使用メモリ 86,432 KB
実行使用メモリ 90,432 KB
最終ジャッジ日時 2023-08-18 09:08:16
合計ジャッジ時間 5,010 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,300 KB
testcase_01 AC 78 ms
71,008 KB
testcase_02 AC 76 ms
71,060 KB
testcase_03 AC 162 ms
90,396 KB
testcase_04 AC 86 ms
76,064 KB
testcase_05 AC 95 ms
77,940 KB
testcase_06 AC 91 ms
76,252 KB
testcase_07 AC 103 ms
80,268 KB
testcase_08 AC 126 ms
86,636 KB
testcase_09 AC 133 ms
88,592 KB
testcase_10 AC 88 ms
76,140 KB
testcase_11 AC 99 ms
79,532 KB
testcase_12 AC 121 ms
85,392 KB
testcase_13 AC 117 ms
83,960 KB
testcase_14 AC 87 ms
76,104 KB
testcase_15 AC 99 ms
78,980 KB
testcase_16 AC 90 ms
76,204 KB
testcase_17 AC 131 ms
88,652 KB
testcase_18 AC 137 ms
90,240 KB
testcase_19 AC 118 ms
84,196 KB
testcase_20 AC 107 ms
81,724 KB
testcase_21 AC 128 ms
86,816 KB
testcase_22 AC 129 ms
88,176 KB
testcase_23 AC 138 ms
90,432 KB
testcase_24 AC 134 ms
89,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
A = A[::-1]
S = sum(A)
res = 0
for i in range(N):
    res += A[i] * pow(K,i,S)

print(res%S)
0