結果
| 問題 |
No.245 貫け!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-04 12:35:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 500 bytes |
| コンパイル時間 | 727 ms |
| コンパイル使用メモリ | 64,256 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 00:10:02 |
| 合計ジャッジ時間 | 1,409 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 WA * 7 |
コンパイルメッセージ
main.cpp:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
9 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int N;
int A[200],B[200];
long crs(int ax,int ay,int bx,int by)
{
return ax*by-ay*bx;
}
main()
{
cin>>N;
for(int i=0;i<2*N;i++)cin>>A[i]>>B[i];
int ans=0;
for(int i=0;i<2*N;i++)for(int j=i+1;j<2*N;j++)
{
int cnt=0;
int ax=A[i],ay=B[i],bx=A[j],by=B[j];
for(int k=0;k<N;k++)
{
int cx=A[2*k],cy=B[2*k],dx=A[2*k+1],dy=B[2*k+1];
cnt+=crs(bx-ax,by-ay,cx-ax,cy-ay)*crs(bx-ax,by-ay,dx-ax,dy-ay)<=0;
}
if(ans<cnt)ans=cnt;
}
cout<<ans<<endl;
}