結果
問題 |
No.178 美しいWhitespace (1)
|
ユーザー |
|
提出日時 | 2017-11-16 18:57:42 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 682 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-25 06:37:30 |
合計ジャッジ時間 | 1,523 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 20 WA * 1 |
ソースコード
import sys def main(): N = int(input()) spaces_list = [] odd = False even = False for i in range(N): space, tab = map(int, input().split()) spaces = space + 4 * tab if spaces % 2 == 0: even = True else: odd = True if odd and even: print(-1) sys.exit() spaces_list.append(spaces) #print(spaces_list) if len(set(spaces_list)) == 1: print(0) max_spaces = max(spaces_list) needed_spaces = 0 for spaces in spaces_list: needed_spaces += max_spaces - spaces print(int(needed_spaces / 2)) if __name__ == '__main__': main()