結果

問題 No.2956 Substitute with Average
ユーザー rin204
提出日時 2024-11-08 21:41:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 104,576 KB
最終ジャッジ日時 2024-11-08 21:42:06
合計ジャッジ時間 3,337 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0

for t in range(1, 31):
    B = [a - t for a in A]
    tot = 0
    cnt = 1
    for b in B:
        if b == 0:
            ans += cnt
            cnt += 1
        tot += b


print(n * (n + 1) // 2 - ans + 1)
0