結果

問題 No.1343 Dividing Digit
ユーザー titiatitia
提出日時 2021-01-16 13:05:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 251 ms / 2,000 ms
コード長 177 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 18,916 KB
最終ジャッジ日時 2023-08-18 09:08:47
合計ジャッジ時間 4,439 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,812 KB
testcase_01 AC 15 ms
7,792 KB
testcase_02 AC 15 ms
7,940 KB
testcase_03 AC 236 ms
18,128 KB
testcase_04 AC 33 ms
9,212 KB
testcase_05 AC 71 ms
10,976 KB
testcase_06 AC 48 ms
9,988 KB
testcase_07 AC 95 ms
11,824 KB
testcase_08 AC 192 ms
16,468 KB
testcase_09 AC 214 ms
17,128 KB
testcase_10 AC 42 ms
9,660 KB
testcase_11 AC 89 ms
11,596 KB
testcase_12 AC 170 ms
15,756 KB
testcase_13 AC 158 ms
15,376 KB
testcase_14 AC 39 ms
9,448 KB
testcase_15 AC 81 ms
11,400 KB
testcase_16 AC 42 ms
9,648 KB
testcase_17 AC 207 ms
17,132 KB
testcase_18 AC 231 ms
18,072 KB
testcase_19 AC 158 ms
14,860 KB
testcase_20 AC 112 ms
12,860 KB
testcase_21 AC 200 ms
17,028 KB
testcase_22 AC 203 ms
16,896 KB
testcase_23 AC 251 ms
18,916 KB
testcase_24 AC 191 ms
9,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

S=sum(A)

X=0
for i in range(N):
    X=(X+A[N-1-i]*pow(K,i,S))%S

print(X)
0