結果
問題 | No.1343 Dividing Digit |
ユーザー | tcltk |
提出日時 | 2021-01-20 17:59:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 330 ms / 2,000 ms |
コード長 | 653 bytes |
コンパイル時間 | 261 ms |
コンパイル使用メモリ | 87,136 KB |
実行使用メモリ | 107,940 KB |
最終ジャッジ日時 | 2023-08-24 21:46:30 |
合計ジャッジ時間 | 9,028 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 251 ms
91,944 KB |
testcase_01 | AC | 248 ms
92,116 KB |
testcase_02 | AC | 252 ms
91,984 KB |
testcase_03 | AC | 324 ms
105,408 KB |
testcase_04 | AC | 261 ms
92,804 KB |
testcase_05 | AC | 276 ms
96,316 KB |
testcase_06 | AC | 273 ms
94,848 KB |
testcase_07 | AC | 289 ms
98,728 KB |
testcase_08 | AC | 313 ms
105,332 KB |
testcase_09 | AC | 320 ms
106,792 KB |
testcase_10 | AC | 266 ms
92,892 KB |
testcase_11 | AC | 288 ms
98,064 KB |
testcase_12 | AC | 304 ms
104,128 KB |
testcase_13 | AC | 296 ms
103,088 KB |
testcase_14 | AC | 262 ms
93,240 KB |
testcase_15 | AC | 281 ms
97,504 KB |
testcase_16 | AC | 266 ms
92,892 KB |
testcase_17 | AC | 313 ms
107,088 KB |
testcase_18 | AC | 330 ms
105,324 KB |
testcase_19 | AC | 302 ms
102,676 KB |
testcase_20 | AC | 296 ms
100,108 KB |
testcase_21 | AC | 315 ms
105,308 KB |
testcase_22 | AC | 316 ms
106,616 KB |
testcase_23 | AC | 322 ms
105,972 KB |
testcase_24 | AC | 323 ms
107,940 KB |
ソースコード
#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(reversed(list(map(int, input().split())))) SumA = sum(A) A = sum((A[i] * pow(K, i, SumA)) % SumA for i in range(N)) print(A % SumA) if __name__ == '__main__': main()