Submission #18981700


Source Code Expand

Copy
//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 1000000007;//998244353
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}
typedef long double ld;
ld dist(pair<ld, ld>a, pair<ld, ld>b){
	return sqrt((a.fi-b.fi)*(a.fi-b.fi) + (a.sc-b.sc)*(a.sc-b.sc));
}
ld solve(pair<ld, ld>a, pair<ld, ld>b, pair<ld, ld>c){
	ld ab = dist(a, b), bc = dist(b, c), ca = dist(c, a);
	ld B = (ab*ab+bc*bc-ca*ca)/2.0/ab/bc; B = acos(B);
	ld C = (ca*ca+bc*bc-ab*ab)/2.0/ca/bc; C = acos(C);
	ld lb = 0., ub = 10000.;
	rep(x, 114514){
		ld mid = (lb+ub)/2;
		if(mid / tan(B/2) + mid / tan(C/2) + mid * 2.0L > bc) ub = mid;
		else lb = mid;
	}
	return lb;
}
int main(){
	ld x[3], y[3];
	rep(i, 3) cin >> x[i] >> y[i];
	ld ans = 0;
	rep(a, 3){
		rep(b, 3) rep(c, b){
			if(a == b || a == c) continue;
			chmax(ans, solve(mp(x[a], y[a]), mp(x[b], y[b]), mp(x[c], y[c])));
		}
	}
	printf("%.12Lf\n", ans);
}

Submission Info

Submission Time
Task B - Inscribed Bicycle
User IH19980412
Language C++ (GCC 9.2.1)
Score 500
Code Size 2174 Byte
Status AC
Exec Time 16 ms
Memory 3824 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 18
Set Name Test Cases
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt AC 11 ms 3624 KB
001.txt AC 7 ms 3612 KB
002.txt AC 6 ms 3616 KB
003.txt AC 7 ms 3604 KB
004.txt AC 8 ms 3676 KB
005.txt AC 6 ms 3736 KB
006.txt AC 9 ms 3676 KB
007.txt AC 7 ms 3824 KB
008.txt AC 6 ms 3656 KB
009.txt AC 6 ms 3596 KB
010.txt AC 16 ms 3716 KB
011.txt AC 8 ms 3748 KB
012.txt AC 10 ms 3668 KB
013.txt AC 5 ms 3668 KB
014.txt AC 10 ms 3692 KB
015.txt AC 6 ms 3672 KB
example0.txt AC 9 ms 3708 KB
example1.txt AC 9 ms 3656 KB