結果

問題 No.1343 Dividing Digit
ユーザー O2MTO2MT
提出日時 2021-02-12 12:57:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 89,648 KB
最終ジャッジ日時 2023-09-26 12:32:16
合計ジャッジ時間 4,313 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,256 KB
testcase_01 AC 65 ms
71,316 KB
testcase_02 AC 66 ms
71,060 KB
testcase_03 AC 89 ms
89,648 KB
testcase_04 AC 78 ms
75,984 KB
testcase_05 AC 77 ms
77,796 KB
testcase_06 AC 76 ms
76,368 KB
testcase_07 AC 78 ms
79,840 KB
testcase_08 AC 88 ms
86,088 KB
testcase_09 AC 91 ms
87,608 KB
testcase_10 AC 74 ms
75,892 KB
testcase_11 AC 79 ms
79,380 KB
testcase_12 AC 85 ms
84,648 KB
testcase_13 AC 85 ms
83,524 KB
testcase_14 AC 72 ms
76,036 KB
testcase_15 AC 77 ms
78,720 KB
testcase_16 AC 73 ms
76,040 KB
testcase_17 AC 90 ms
87,556 KB
testcase_18 AC 91 ms
89,256 KB
testcase_19 AC 82 ms
83,296 KB
testcase_20 AC 80 ms
81,180 KB
testcase_21 AC 87 ms
86,076 KB
testcase_22 AC 88 ms
87,652 KB
testcase_23 AC 92 ms
89,404 KB
testcase_24 AC 89 ms
88,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

########関数部分##############
def Base_n_to_10(X,n,a):
    out = 0
    k = 1
    for i in range(len(X)):
        x = X[i]
        if i > 0:
            k *= n
        k %= a
        out += x*k
        out %= a

    return out#int out
############################

N,K = map(int,input().split())
A = list(map(int,input().split()))
sumA = sum(A)
A.reverse()
numA = Base_n_to_10(A,K,sumA)

print(numA%sumA)
0