結果

問題 No.3074 Divide Points Fairly
ユーザー 👑 p-adic
提出日時 2025-02-16 20:10:35
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 327 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 95,740 KB
最終ジャッジ日時 2025-03-27 12:52:19
合計ジャッジ時間 11,433 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import random
R=range
J=lambda:list(map(int,input().split()))
N,*_=J()
P=[J()for i in R(N*2)]
L=10**5
C=L*L
def D(c):
	h=d=0
	for x,y in P:
		v=x+b*y+c;h|=v==0;d+=v>0
	return h,d
while 1:
	b,l,r=random.randint(-L,L),-C-1,C
	while l+1<r:
		m=(l+r)>>1;h,d=D(m)
		if d<N:l=m
		else:r=m
	h,d=D(r)
	if h<1and d==N:exit(print(1,b,r))
0