結果

問題 No.1343 Dividing Digit
ユーザー Omura ShunsukeOmura Shunsuke
提出日時 2021-01-16 15:45:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 386 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 97,104 KB
最終ジャッジ日時 2023-08-18 13:21:24
合計ジャッジ時間 4,072 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,580 KB
testcase_01 AC 78 ms
71,324 KB
testcase_02 AC 77 ms
71,148 KB
testcase_03 AC 107 ms
96,768 KB
testcase_04 AC 83 ms
76,460 KB
testcase_05 AC 89 ms
79,672 KB
testcase_06 AC 84 ms
76,992 KB
testcase_07 AC 90 ms
82,376 KB
testcase_08 AC 100 ms
91,912 KB
testcase_09 AC 102 ms
94,328 KB
testcase_10 AC 84 ms
76,544 KB
testcase_11 AC 90 ms
81,304 KB
testcase_12 AC 97 ms
89,680 KB
testcase_13 AC 97 ms
87,988 KB
testcase_14 AC 84 ms
76,668 KB
testcase_15 AC 88 ms
80,468 KB
testcase_16 AC 83 ms
76,428 KB
testcase_17 AC 102 ms
94,212 KB
testcase_18 AC 105 ms
96,904 KB
testcase_19 AC 96 ms
87,932 KB
testcase_20 AC 92 ms
84,180 KB
testcase_21 AC 102 ms
92,056 KB
testcase_22 AC 102 ms
93,300 KB
testcase_23 AC 106 ms
97,104 KB
testcase_24 AC 104 ms
96,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))

A=A[::-1]

mod=sum(A)

L=[1]
for i in range(1,N):
    L.append(L[-1]*K%mod)
#print(L)

ans=0
for i in range(N):
    ans+=A[i]*L[i]
print(ans%mod)
0