結果

問題 No.1389 Clumsy Calculation
ユーザー ohana
提出日時 2023-11-17 09:59:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 107,648 KB
最終ジャッジ日時 2024-09-26 05:17:51
合計ジャッジ時間 5,348 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x = map(int, input().split())
S = list(map(int, input().split()))
A = [x - s for s in S]

sm = sum(A)

for a, s in zip(A, S):
    if s % 2:
        continue
    if sm - a == s // 2:
        print(s // 2)
        break
0