結果
問題 |
No.178 美しいWhitespace (1)
|
ユーザー |
![]() |
提出日時 | 2025-06-12 20:25:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 54 ms / 2,000 ms |
コード長 | 433 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 62,268 KB |
最終ジャッジ日時 | 2025-06-12 20:25:31 |
合計ジャッジ時間 | 2,270 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
n = int(input()) s_list = [] parity = None possible = True for _ in range(n): a, b = map(int, input().split()) s = a + 4 * b s_list.append(s) if parity is None: parity = s % 2 else: if s % 2 != parity: possible = False if not possible: print(-1) else: max_s = max(s_list) total = 0 for s in s_list: diff = max_s - s total += diff // 2 print(total)