結果

問題 No.245 貫け!
ユーザー tailstails
提出日時 2015-07-17 22:54:45
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 508 bytes
コンパイル時間 1,076 ms
コンパイル使用メモリ 144,276 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-22 18:01:08
合計ジャッジ時間 2,020 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 4 ms
4,380 KB
testcase_12 AC 7 ms
4,380 KB
testcase_13 AC 7 ms
4,380 KB
testcase_14 AC 7 ms
4,380 KB
testcase_15 AC 7 ms
4,376 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 7 ms
4,376 KB
testcase_18 AC 8 ms
4,376 KB
testcase_19 AC 8 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)

int N;
struct P { int x,y; };
P p[100][2];

P l,m;

int f(P const & p){
	return (p.x-l.x)*(m.y-l.y)-(p.y-l.y)*(m.x-l.x);
}

int main(){
	cin>>N;
	rep(i,N)cin>>p[i][0].x>>p[i][0].y>>p[i][1].x>>p[i][1].y;

	int b=0;
	rep(j,N)rep(jj,2)rep(k,j)rep(kk,2){
		l=p[j][jj];
		m=p[k][kk];
		if(l.x!=m.x||l.y!=m.y){
			int c=0;
			rep(i,N){
				if(f(p[i][0])*f(p[i][1])<=0){
					++c;
				}
			}
			if(b<c)b=c;
		}
	}
	cout<<b;
}

0