結果
問題 |
No.245 貫け!
|
ユーザー |
![]() |
提出日時 | 2015-07-19 01:32:41 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 132 ms / 5,000 ms |
コード長 | 482 bytes |
コンパイル時間 | 102 ms |
コンパイル使用メモリ | 77,192 KB |
実行使用メモリ | 78,240 KB |
最終ジャッジ日時 | 2024-07-08 10:15:01 |
合計ジャッジ時間 | 2,719 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
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