結果
| 問題 |
No.1343 Dividing Digit
|
| コンテスト | |
| ユーザー |
Ultimate_Tea_04
|
| 提出日時 | 2021-01-17 16:21:36 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 305 bytes |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 30,972 KB |
| 最終ジャッジ日時 | 2024-11-29 19:37:53 |
| 合計ジャッジ時間 | 67,785 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 22 |
ソースコード
def powf(x,n):
if n == 0:
return 1
k = 1
while n>1:
if n%2 != 0:
k *= x
x *= x
n //= 2
return k*x
n,k = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a)
ans = 0
for i in range(n):
ans += a[n-1-i]*powf(k,i)
print(ans%s)
Ultimate_Tea_04