結果

問題 No.1343 Dividing Digit
ユーザー Omura ShunsukeOmura Shunsuke
提出日時 2021-01-16 15:45:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 87,936 KB
最終ジャッジ日時 2024-05-05 18:36:33
合計ジャッジ時間 2,508 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,840 KB
testcase_01 AC 37 ms
52,096 KB
testcase_02 AC 37 ms
52,096 KB
testcase_03 AC 67 ms
87,936 KB
testcase_04 AC 45 ms
62,432 KB
testcase_05 AC 49 ms
67,584 KB
testcase_06 AC 47 ms
64,128 KB
testcase_07 AC 54 ms
70,400 KB
testcase_08 AC 62 ms
82,304 KB
testcase_09 AC 63 ms
84,608 KB
testcase_10 AC 46 ms
63,104 KB
testcase_11 AC 51 ms
69,504 KB
testcase_12 AC 60 ms
79,616 KB
testcase_13 AC 57 ms
77,440 KB
testcase_14 AC 45 ms
62,976 KB
testcase_15 AC 50 ms
68,352 KB
testcase_16 AC 45 ms
63,544 KB
testcase_17 AC 64 ms
84,608 KB
testcase_18 AC 67 ms
87,808 KB
testcase_19 AC 58 ms
77,440 KB
testcase_20 AC 53 ms
72,960 KB
testcase_21 AC 62 ms
82,048 KB
testcase_22 AC 64 ms
83,456 KB
testcase_23 AC 67 ms
87,936 KB
testcase_24 AC 64 ms
86,656 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