結果
問題 | No.178 美しいWhitespace (1) |
ユーザー |
![]() |
提出日時 | 2016-03-03 16:16:33 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 494 bytes |
コンパイル時間 | 416 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-24 13:46:57 |
合計ジャッジ時間 | 1,812 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#coding: UTF-8 import sys import re import itertools from math import log from collections import deque ### defs ### ### main ### N = int(sys.stdin.readline()) AB = [] for _ in range(N): a,b=map(int,sys.stdin.readline().split()) AB.append((a,b)) if (len(list(filter(lambda x:(x[0]+4*x[1])%2==0,AB))) != 0 and len(list(filter(lambda x:(x[0]+4*x[1])%2==1,AB))) != 0): print(-1) else: mx = max(map(lambda x:x[0]+4*x[1], AB)) ans = sum(map(lambda x:(mx - x[0]-4*x[1])//2, AB)) print(ans)