結果
| 問題 |
No.245 貫け!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-04 12:28:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 5,000 ms |
| コード長 | 747 bytes |
| コンパイル時間 | 972 ms |
| コンパイル使用メモリ | 89,220 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 00:09:51 |
| 合計ジャッジ時間 | 2,335 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
コンパイルメッセージ
main.cpp:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
30 | main()
| ^~~~
ソースコード
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int N;
int A[100],B[100],C[100],D[100];
int cnt(double theta)
{
vector<pair<double,double> >X;
double c=cos(theta),s=sin(theta);
for(int i=0;i<N;i++)
{
double L=A[i]*c-B[i]*s;
double R=C[i]*c-D[i]*s;
X.push_back(minmax(L,R));
}
sort(X.begin(),X.end());
priority_queue<double>P;
int ret=0;
for(pair<double,double>p:X)
{
while(!P.empty()&&-P.top()<p.first-1e-10)P.pop();
P.push(-p.second);
ret=max(ret,(int)P.size());
}
return ret;
}
main()
{
cin>>N;
for(int i=0;i<N;i++)cin>>A[i]>>B[i]>>C[i]>>D[i];
int ans=0;
const int LIM=1e4;
for(int i=0;i<LIM;i++)
{
ans=max(ans,cnt(M_PI*i/LIM));
}
cout<<ans<<endl;
}