結果

問題 No.1343 Dividing Digit
ユーザー tcltktcltk
提出日時 2021-01-20 17:57:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 641 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 107,168 KB
最終ジャッジ日時 2023-08-24 21:44:47
合計ジャッジ時間 8,991 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 256 ms
91,916 KB
testcase_01 AC 252 ms
91,832 KB
testcase_02 AC 257 ms
91,756 KB
testcase_03 AC 319 ms
104,540 KB
testcase_04 AC 262 ms
93,056 KB
testcase_05 AC 274 ms
95,864 KB
testcase_06 AC 263 ms
94,732 KB
testcase_07 AC 279 ms
97,964 KB
testcase_08 AC 304 ms
104,800 KB
testcase_09 AC 316 ms
105,964 KB
testcase_10 AC 261 ms
92,840 KB
testcase_11 AC 278 ms
97,208 KB
testcase_12 AC 303 ms
103,604 KB
testcase_13 AC 299 ms
102,004 KB
testcase_14 AC 261 ms
92,916 KB
testcase_15 AC 279 ms
97,092 KB
testcase_16 AC 268 ms
92,860 KB
testcase_17 AC 318 ms
106,224 KB
testcase_18 AC 322 ms
104,524 KB
testcase_19 AC 307 ms
102,108 KB
testcase_20 AC 289 ms
99,532 KB
testcase_21 AC 320 ms
104,516 KB
testcase_22 AC 323 ms
105,676 KB
testcase_23 AC 330 ms
105,112 KB
testcase_24 AC 325 ms
107,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#region Header
#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
from queue import PriorityQueue
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

sys.setrecursionlimit(1000000)
#endregion

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)

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

    SumA = sum(A)
    A = sum((A[N-1-i] * pow(K, i, SumA)) % SumA for i in range(N))
    print(A % SumA)


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