Submission #59019922


Source Code Expand

#include <bits/stdc++.h>
#include<atcoder/all>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using namespace atcoder;
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef modint1000000007 mi;
constexpr ll mod=1000000007;
constexpr double PI=3.141592653589793238;
int x[2002],y[2002];

int main(){
	int n;cin>>n;
	rep(i,n)cin>>x[i]>>y[i];
	double ans=0;

	rep(i,n){
		vector<double>arg;
		rep(j,n){
			if(i==j)continue;
			arg.push_back(atan2(y[j]-y[i],x[j]-x[i]));
		}
		sort(all(arg));
		rep(j,n+1)arg.push_back(arg[j]+2*PI);
		rep(j,n-1){
			auto itr=upper_bound(all(arg),arg[j]+PI);
			itr--;
			ans=max(ans,(*itr)-arg[j]);
		}
	}
	cout<<fixed<<setprecision(11)<<ans/PI*180<<endl;
}

Submission Info

Submission Time
Task 009 - Three Point Angle(★6)
User Rho17
Language C++ 20 (gcc 12.2)
Score 6
Code Size 764 Byte
Status AC
Exec Time 342 ms
Memory 4152 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 6 / 6
Status
AC × 4
AC × 29
Set Name Test Cases
Sample Sample_1.txt, Sample_2.txt, Sample_3.txt, Sample_4.txt
All Random_1.txt, Random_2.txt, Random_3.txt, Random_4.txt, Random_5.txt, Random_6.txt, Random_7.txt, Random_8.txt, Regular_Polygon_1.txt, Regular_Polygon_2.txt, Regular_Polygon_3.txt, Regular_Polygon_4.txt, Regular_Polygon_5.txt, Regular_Polygon_6.txt, Regular_Polygon_7.txt, Regular_Polygon_8.txt, Sample_1.txt, Sample_2.txt, Sample_3.txt, Sample_4.txt, Small_1.txt, Small_2.txt, Small_3.txt, Small_4.txt, Small_5.txt, Small_6.txt, Small_7.txt, Small_8.txt, Three_Linear_1.txt
Case Name Status Exec Time Memory
Random_1.txt AC 8 ms 4100 KiB
Random_2.txt AC 167 ms 3992 KiB
Random_3.txt AC 25 ms 3960 KiB
Random_4.txt AC 53 ms 3960 KiB
Random_5.txt AC 134 ms 4128 KiB
Random_6.txt AC 29 ms 4056 KiB
Random_7.txt AC 255 ms 4016 KiB
Random_8.txt AC 342 ms 4032 KiB
Regular_Polygon_1.txt AC 1 ms 3952 KiB
Regular_Polygon_2.txt AC 1 ms 3908 KiB
Regular_Polygon_3.txt AC 63 ms 4152 KiB
Regular_Polygon_4.txt AC 60 ms 4124 KiB
Regular_Polygon_5.txt AC 39 ms 3988 KiB
Regular_Polygon_6.txt AC 142 ms 4000 KiB
Regular_Polygon_7.txt AC 71 ms 4016 KiB
Regular_Polygon_8.txt AC 157 ms 4148 KiB
Sample_1.txt AC 1 ms 3960 KiB
Sample_2.txt AC 1 ms 4012 KiB
Sample_3.txt AC 1 ms 4032 KiB
Sample_4.txt AC 1 ms 3932 KiB
Small_1.txt AC 1 ms 3900 KiB
Small_2.txt AC 1 ms 4004 KiB
Small_3.txt AC 1 ms 3848 KiB
Small_4.txt AC 1 ms 3984 KiB
Small_5.txt AC 1 ms 4092 KiB
Small_6.txt AC 1 ms 4032 KiB
Small_7.txt AC 1 ms 4008 KiB
Small_8.txt AC 1 ms 3840 KiB
Three_Linear_1.txt AC 1 ms 3944 KiB