結果

問題 No.245 貫け!
ユーザー TawaraTawara
提出日時 2015-07-19 01:30:36
言語 Python2
(2.7.18)
結果
AC  
実行時間 620 ms / 5,000 ms
コード長 481 bytes
コンパイル時間 980 ms
コンパイル使用メモリ 6,608 KB
実行使用メモリ 6,140 KB
最終ジャッジ日時 2023-08-25 02:11:34
合計ジャッジ時間 7,420 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,032 KB
testcase_01 AC 12 ms
6,028 KB
testcase_02 AC 11 ms
5,996 KB
testcase_03 AC 12 ms
5,888 KB
testcase_04 AC 11 ms
5,944 KB
testcase_05 AC 11 ms
6,044 KB
testcase_06 AC 11 ms
5,952 KB
testcase_07 AC 11 ms
6,016 KB
testcase_08 AC 18 ms
5,892 KB
testcase_09 AC 49 ms
6,000 KB
testcase_10 AC 66 ms
6,140 KB
testcase_11 AC 228 ms
6,028 KB
testcase_12 AC 609 ms
5,984 KB
testcase_13 AC 605 ms
5,964 KB
testcase_14 AC 591 ms
6,088 KB
testcase_15 AC 611 ms
5,964 KB
testcase_16 AC 615 ms
6,072 KB
testcase_17 AC 598 ms
6,064 KB
testcase_18 AC 620 ms
6,008 KB
testcase_19 AC 610 ms
6,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations as comb
def count(x1, y1, x2, y2):
	num = 0
	for a,b,c,d in line:
		if ((x1-x2)*(b-y1) - (y1-y2)*(a-x1))*((x1-x2)*(d-y1) - (y1-y2)*(c-x1)) <= 0:
			num += 1
	return num

N = int(raw_input())
line = [map(int,raw_input().split(" ")) for i in range(N)]
p = set([(line[i/2][(2*i)%4],line[i/2][(2*i)%4+1]) for i in range(2*N)])
max_num = 1
for p1, p2 in comb(p,2):
	tmp = count(p1[0],p1[1],p2[0],p2[1])
	if tmp > max_num:
		max_num = tmp
print max_num
0