結果
問題 | No.1389 Clumsy Calculation |
ユーザー |
![]() |
提出日時 | 2021-02-12 21:58:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 108 ms / 2,000 ms |
コード長 | 450 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 82,352 KB |
実行使用メモリ | 110,336 KB |
最終ジャッジ日時 | 2024-07-19 21:17:41 |
合計ジャッジ時間 | 3,950 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
n, x = map(int, input().split()) s = list(map(int, input().split())) fromLeft = [0] * (n + 1) fromRight = [0] * (n + 1) for i in range(len(s)): fromLeft[i + 1] = fromLeft[i] + s[i] for i in reversed(range(len(s))): fromRight[i] = fromRight[i + 1] + s[i] for i in range(len(s)): if s[i] % 2 != 0: continue half = s[i] // 2 if fromLeft[i] + fromRight[i + 1] + half == (n - 1) * x: print(half) exit()