結果

問題 No.1343 Dividing Digit
ユーザー hiragnhiragn
提出日時 2022-11-24 08:55:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 21,284 KB
最終ジャッジ日時 2023-10-26 00:58:30
合計ジャッジ時間 3,504 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,052 KB
testcase_01 AC 26 ms
10,052 KB
testcase_02 AC 26 ms
10,052 KB
testcase_03 AC 66 ms
20,696 KB
testcase_04 AC 29 ms
11,012 KB
testcase_05 AC 37 ms
13,056 KB
testcase_06 AC 33 ms
11,812 KB
testcase_07 AC 42 ms
14,212 KB
testcase_08 AC 59 ms
18,432 KB
testcase_09 AC 60 ms
19,376 KB
testcase_10 AC 32 ms
11,568 KB
testcase_11 AC 38 ms
13,460 KB
testcase_12 AC 53 ms
18,004 KB
testcase_13 AC 53 ms
17,208 KB
testcase_14 AC 33 ms
11,280 KB
testcase_15 AC 39 ms
13,264 KB
testcase_16 AC 33 ms
11,540 KB
testcase_17 AC 61 ms
19,376 KB
testcase_18 AC 67 ms
20,584 KB
testcase_19 AC 54 ms
17,332 KB
testcase_20 AC 43 ms
14,796 KB
testcase_21 AC 59 ms
19,212 KB
testcase_22 AC 60 ms
18,896 KB
testcase_23 AC 65 ms
21,284 KB
testcase_24 AC 51 ms
11,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n, k = map(int, input().split())
    arr = list(map(int, input().split()))

    mod = sum(arr)
    ans = arr[0]
    for a in arr[1:]:
        ans = (ans * k + a) % mod
    print(ans)


if __name__ == "__main__":
    main()
0