結果

問題 No.1343 Dividing Digit
ユーザー NoaSaberNoaSaber
提出日時 2021-04-24 08:55:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 90,916 KB
最終ジャッジ日時 2023-09-17 13:30:29
合計ジャッジ時間 3,656 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,144 KB
testcase_01 AC 70 ms
70,952 KB
testcase_02 AC 72 ms
71,496 KB
testcase_03 AC 95 ms
90,500 KB
testcase_04 AC 78 ms
76,612 KB
testcase_05 AC 81 ms
78,408 KB
testcase_06 AC 79 ms
76,888 KB
testcase_07 AC 83 ms
80,648 KB
testcase_08 AC 91 ms
87,084 KB
testcase_09 AC 96 ms
88,728 KB
testcase_10 AC 79 ms
76,380 KB
testcase_11 AC 83 ms
79,604 KB
testcase_12 AC 91 ms
85,636 KB
testcase_13 AC 88 ms
84,344 KB
testcase_14 AC 76 ms
76,244 KB
testcase_15 AC 80 ms
79,304 KB
testcase_16 AC 76 ms
76,520 KB
testcase_17 AC 92 ms
88,480 KB
testcase_18 AC 95 ms
90,584 KB
testcase_19 AC 88 ms
84,452 KB
testcase_20 AC 84 ms
82,184 KB
testcase_21 AC 91 ms
87,268 KB
testcase_22 AC 91 ms
88,300 KB
testcase_23 AC 95 ms
90,916 KB
testcase_24 AC 92 ms
89,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
tmp=1
sum_n=0
sum_b=sum(A)
for i in A[::-1]:
    sum_n+=tmp*i%sum_b
    tmp*=K
    tmp%=sum_b
    sum_n%=sum_b
print(sum_n%sum_b)
0