結果

問題 No.1343 Dividing Digit
ユーザー 👑 KazunKazun
提出日時 2021-03-16 00:19:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 80,256 KB
最終ジャッジ日時 2024-04-25 03:15:15
合計ジャッジ時間 2,552 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,584 KB
testcase_01 AC 39 ms
51,840 KB
testcase_02 AC 39 ms
51,584 KB
testcase_03 AC 68 ms
79,616 KB
testcase_04 AC 50 ms
60,928 KB
testcase_05 AC 53 ms
64,640 KB
testcase_06 AC 52 ms
62,464 KB
testcase_07 AC 56 ms
67,072 KB
testcase_08 AC 65 ms
75,520 KB
testcase_09 AC 68 ms
77,440 KB
testcase_10 AC 51 ms
61,568 KB
testcase_11 AC 56 ms
65,920 KB
testcase_12 AC 64 ms
73,600 KB
testcase_13 AC 62 ms
72,064 KB
testcase_14 AC 50 ms
61,312 KB
testcase_15 AC 54 ms
65,152 KB
testcase_16 AC 50 ms
61,824 KB
testcase_17 AC 66 ms
77,440 KB
testcase_18 AC 70 ms
79,616 KB
testcase_19 AC 62 ms
71,936 KB
testcase_20 AC 58 ms
68,864 KB
testcase_21 AC 66 ms
75,648 KB
testcase_22 AC 67 ms
76,928 KB
testcase_23 AC 70 ms
80,256 KB
testcase_24 AC 67 ms
78,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

A_sum=sum(A)
X=0
power=1
for a in A[::-1]:
    X+=a*power
    power*=K
    power%=A_sum

print(X%A_sum)
0