結果

問題 No.245 貫け!
ユーザー TawaraTawara
提出日時 2015-07-19 01:32:41
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 482 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 78,004 KB
実行使用メモリ 79,320 KB
最終ジャッジ日時 2023-09-22 19:06:03
合計ジャッジ時間 3,250 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,932 KB
testcase_01 AC 73 ms
76,716 KB
testcase_02 AC 72 ms
76,436 KB
testcase_03 AC 71 ms
76,388 KB
testcase_04 AC 72 ms
76,224 KB
testcase_05 AC 72 ms
76,428 KB
testcase_06 AC 74 ms
76,404 KB
testcase_07 AC 72 ms
76,408 KB
testcase_08 AC 81 ms
78,464 KB
testcase_09 AC 91 ms
78,704 KB
testcase_10 AC 92 ms
78,760 KB
testcase_11 AC 105 ms
78,660 KB
testcase_12 AC 135 ms
78,668 KB
testcase_13 AC 129 ms
79,320 KB
testcase_14 AC 129 ms
79,068 KB
testcase_15 AC 133 ms
78,680 KB
testcase_16 AC 136 ms
78,900 KB
testcase_17 AC 132 ms
78,560 KB
testcase_18 AC 138 ms
79,072 KB
testcase_19 AC 139 ms
78,832 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