結果
| 問題 | No.180 美しいWhitespace (2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-06 00:29:31 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 584 bytes |
| 記録 | |
| コンパイル時間 | 126 ms |
| コンパイル使用メモリ | 77,428 KB |
| 最終ジャッジ日時 | 2025-12-03 14:34:34 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 7 TLE * 1 -- * 23 |
ソースコード
N = int(raw_input())
ab = [map(int, raw_input().split()) for i in xrange(N)]
candx = set([])
for i in xrange(N):
a1, b1 = ab[i]
for j in xrange(i+1, N):
a2, b2 = ab[j]
if b2-b1 == 0:
candx.add(0)
continue
x = abs((a1-a2)/(b1-b2))
if x > 0: candx.add(x)
if x >= 0: candx.add(x+1)
if x > 1: candx.add(x-1)
ax, mn = 0, 10**50
for x in candx:
abx = [a+b*x for a,b in ab]
tmp = max(abx) - min(abx)
if tmp < mn:
mn = tmp
ax = x
if tmp == mn:
ax = min(x, ax)
print ax