結果

問題 No.1081 和の和
ユーザー pete1288998pete1288998
提出日時 2020-06-20 21:49:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 8,000 KB
最終ジャッジ日時 2023-09-16 17:46:48
合計ジャッジ時間 1,449 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,900 KB
testcase_01 AC 15 ms
7,852 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))

ans = 0
if [str(i) for i in A].count(str(A[0])) == n:
    ans = A[0]*2**(n-1)
else:
    for i in range(n):
        if i == 0 or i == n-1:
            ans += A[i]
        else:
            ans += A[i]*(n-1)
    
print(ans%(10**9+7))
0