結果

問題 No.180 美しいWhitespace (2)
ユーザー roiti46roiti46
提出日時 2015-04-06 00:33:42
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 77,624 KB
実行使用メモリ 160,056 KB
最終ジャッジ日時 2023-09-17 05:01:09
合計ジャッジ時間 20,738 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,504 KB
testcase_01 AC 74 ms
76,584 KB
testcase_02 AC 74 ms
76,348 KB
testcase_03 AC 72 ms
76,852 KB
testcase_04 AC 96 ms
79,412 KB
testcase_05 AC 135 ms
80,920 KB
testcase_06 WA -
testcase_07 AC 380 ms
90,308 KB
testcase_08 AC 605 ms
95,252 KB
testcase_09 AC 143 ms
79,660 KB
testcase_10 AC 143 ms
79,500 KB
testcase_11 AC 4,027 ms
151,620 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1,978 ms
114,044 KB
testcase_15 AC 600 ms
87,276 KB
testcase_16 AC 315 ms
81,912 KB
testcase_17 AC 189 ms
79,636 KB
testcase_18 AC 153 ms
79,892 KB
testcase_19 AC 144 ms
79,800 KB
testcase_20 AC 74 ms
76,592 KB
testcase_21 AC 74 ms
76,496 KB
testcase_22 AC 74 ms
76,496 KB
testcase_23 AC 74 ms
76,588 KB
testcase_24 AC 76 ms
76,612 KB
testcase_25 AC 74 ms
76,528 KB
testcase_26 AC 74 ms
76,296 KB
testcase_27 AC 75 ms
76,584 KB
testcase_28 AC 77 ms
76,588 KB
testcase_29 AC 73 ms
76,624 KB
testcase_30 AC 115 ms
79,368 KB
testcase_31 AC 116 ms
79,392 KB
testcase_32 AC 94 ms
79,692 KB
testcase_33 AC 108 ms
79,280 KB
testcase_34 AC 107 ms
79,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
ab = [map(int, raw_input().split()) for i in xrange(N)]

candx = set([1])
for i in xrange(N):
    a1, b1 = ab[i]
    for j in xrange(i+1, N):
        a2, b2 = ab[j]
        if b2-b1 == 0:
            continue
        x = abs((a1-a2)/(b1-b2))
        if x >  0: candx.add(x)

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
0