結果

問題 No.245 貫け!
ユーザー yaoshimaxyaoshimax
提出日時 2016-05-07 20:41:44
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,767 ms / 5,000 ms
コード長 734 bytes
コンパイル時間 51 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-04-15 13:40:06
合計ジャッジ時間 15,678 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,272 KB
testcase_01 AC 11 ms
6,272 KB
testcase_02 AC 12 ms
6,400 KB
testcase_03 AC 12 ms
6,272 KB
testcase_04 AC 12 ms
6,272 KB
testcase_05 AC 13 ms
6,272 KB
testcase_06 AC 12 ms
6,400 KB
testcase_07 AC 11 ms
6,400 KB
testcase_08 AC 27 ms
6,272 KB
testcase_09 AC 114 ms
6,272 KB
testcase_10 AC 161 ms
6,144 KB
testcase_11 AC 624 ms
6,272 KB
testcase_12 AC 1,767 ms
6,400 KB
testcase_13 AC 1,687 ms
6,144 KB
testcase_14 AC 1,695 ms
6,272 KB
testcase_15 AC 1,691 ms
6,272 KB
testcase_16 AC 1,767 ms
6,144 KB
testcase_17 AC 1,700 ms
6,272 KB
testcase_18 AC 1,698 ms
6,272 KB
testcase_19 AC 1,710 ms
6,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(raw_input())
points=[map(int,raw_input().split()) for i in range(N)]
ans=1
for i in range(N):
    for j in range(i+1,N):
        for k in range(2):
            for l in range(2):
                cnt=0
                x,y=points[i][k*2],points[i][k*2+1]
                x2,y2=points[j][l*2],points[j][l*2+1]
                if (x,y)==(x2,y2):
                    continue
                vx,vy=x2-x,y2-y
                for t in range(N):
                    a,b,c,d=points[t]
                    wx,wy=a-x,b-y
                    zx,zy=c-x,d-y
                    det1=vy*wx-vx*wy
                    det2=vy*zx-vx*zy
                    if det1*det2<=0:
                       cnt+=1
                ans=max(cnt,ans)
print ans
0