結果

問題 No.1343 Dividing Digit
ユーザー nasubi24nasubi24
提出日時 2021-01-16 14:07:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 19,672 KB
最終ジャッジ日時 2023-08-18 10:51:20
合計ジャッジ時間 2,746 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,788 KB
testcase_01 AC 15 ms
7,832 KB
testcase_02 AC 15 ms
7,836 KB
testcase_03 AC 90 ms
18,780 KB
testcase_04 AC 22 ms
9,160 KB
testcase_05 AC 38 ms
10,988 KB
testcase_06 AC 32 ms
10,028 KB
testcase_07 AC 48 ms
12,268 KB
testcase_08 AC 84 ms
16,512 KB
testcase_09 AC 86 ms
17,412 KB
testcase_10 AC 26 ms
9,512 KB
testcase_11 AC 43 ms
11,500 KB
testcase_12 AC 76 ms
15,572 KB
testcase_13 AC 70 ms
15,256 KB
testcase_14 AC 26 ms
9,420 KB
testcase_15 AC 40 ms
11,308 KB
testcase_16 AC 26 ms
9,436 KB
testcase_17 AC 87 ms
17,468 KB
testcase_18 AC 96 ms
18,692 KB
testcase_19 AC 70 ms
15,144 KB
testcase_20 AC 54 ms
12,772 KB
testcase_21 AC 78 ms
17,004 KB
testcase_22 AC 84 ms
17,012 KB
testcase_23 AC 97 ms
19,672 KB
testcase_24 AC 84 ms
9,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
mod=sum(a)
ans=0
num=1
for i in range(n-1,-1,-1):
    ans+=num*a[i]
    ans%=mod
    num*=k
    num%=mod
print(ans)
0