結果
問題 |
No.245 貫け!
|
ユーザー |
|
提出日時 | 2020-03-04 12:34:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 499 bytes |
コンパイル時間 | 479 ms |
コンパイル使用メモリ | 64,256 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 00:09:53 |
合計ジャッジ時間 | 1,164 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]; int 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; }