結果

問題 No.1343 Dividing Digit
ユーザー chineristACchineristAC
提出日時 2021-01-16 13:04:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 159 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 82,944 KB
実行使用メモリ 80,000 KB
最終ジャッジ日時 2024-05-05 14:52:54
合計ジャッジ時間 2,826 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,224 KB
testcase_01 AC 35 ms
51,712 KB
testcase_02 AC 35 ms
51,712 KB
testcase_03 AC 98 ms
79,616 KB
testcase_04 AC 47 ms
61,056 KB
testcase_05 AC 57 ms
64,512 KB
testcase_06 AC 56 ms
62,080 KB
testcase_07 AC 63 ms
67,200 KB
testcase_08 AC 83 ms
75,008 KB
testcase_09 AC 91 ms
77,824 KB
testcase_10 AC 47 ms
61,952 KB
testcase_11 AC 63 ms
65,920 KB
testcase_12 AC 80 ms
73,472 KB
testcase_13 AC 78 ms
72,064 KB
testcase_14 AC 49 ms
61,824 KB
testcase_15 AC 58 ms
65,408 KB
testcase_16 AC 50 ms
61,440 KB
testcase_17 AC 92 ms
77,184 KB
testcase_18 AC 96 ms
79,616 KB
testcase_19 AC 78 ms
71,936 KB
testcase_20 AC 65 ms
68,608 KB
testcase_21 AC 85 ms
75,520 KB
testcase_22 AC 94 ms
76,928 KB
testcase_23 AC 100 ms
80,000 KB
testcase_24 AC 98 ms
78,464 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