結果

問題 No.1343 Dividing Digit
ユーザー lllllll88938494lllllll88938494
提出日時 2022-01-13 00:31:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 91,492 KB
最終ジャッジ日時 2024-04-27 15:15:08
合計ジャッジ時間 3,119 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,684 KB
testcase_01 AC 41 ms
53,628 KB
testcase_02 AC 40 ms
52,568 KB
testcase_03 AC 110 ms
90,036 KB
testcase_04 AC 49 ms
63,680 KB
testcase_05 AC 62 ms
69,732 KB
testcase_06 AC 55 ms
64,628 KB
testcase_07 AC 68 ms
71,872 KB
testcase_08 AC 97 ms
84,012 KB
testcase_09 AC 105 ms
87,500 KB
testcase_10 AC 52 ms
65,000 KB
testcase_11 AC 66 ms
70,208 KB
testcase_12 AC 92 ms
81,464 KB
testcase_13 AC 93 ms
79,760 KB
testcase_14 AC 56 ms
64,100 KB
testcase_15 AC 69 ms
69,520 KB
testcase_16 AC 54 ms
64,756 KB
testcase_17 AC 106 ms
86,800 KB
testcase_18 AC 120 ms
91,492 KB
testcase_19 AC 91 ms
79,292 KB
testcase_20 AC 75 ms
75,124 KB
testcase_21 AC 103 ms
84,252 KB
testcase_22 AC 108 ms
86,316 KB
testcase_23 AC 114 ms
91,392 KB
testcase_24 AC 107 ms
90,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
ns=list(map(int,input().split()))
nss=''.join(list(map(str,ns)))
nssum=sum(ns)

def  n_t(X,n):
    t = 0
    cnt=0
    for i in range(len(X)-1,-1,-1):
        t += X[cnt]*(pow(n,i,nssum)) % nssum
        cnt+=1
    return t
ns10 = n_t(ns,k)

print(ns10%nssum)

0