Submission #3917568
Source Code Expand
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)
using namespace std;
struct pdd{double x, y;};
typedef long long ll;
typedef unsigned long long ull;
double dist(pdd a, pdd b){
double sqd = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
return sqrt(sqd);
}
double calccos(double a, double b, double c){
return (b*b + c*c - a*a) / (2*b*c);
}
double calcr(double l, double th1, double th2){
return l / (2 + 1 / tan(th1 / 2) + 1 / tan(th2 / 2));
}
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
pdd p1, p2, p3;
cin >> p1.x >> p1.y;
cin >> p2.x >> p2.y;
cin >> p3.x >> p3.y;
double l1, l2, l3;
l1 = dist(p2, p3);
l2 = dist(p1, p3);
l3 = dist(p1, p2);
double th1, th2, th3;
th1 = acos(calccos(l1, l2, l3));
th2 = acos(calccos(l2, l1, l3));
th3 = acos(calccos(l3, l1, l2));
double r1, r2, r3;
r1 = calcr(l1, th2, th3);
r2 = calcr(l2, th1, th3);
r3 = calcr(l3, th1, th2);
cout << fixed << setprecision(12) << max({r1, r2, r3}) << endl;
}
Submission Info
Submission Time |
|
Task |
B - Inscribed Bicycle |
User |
misora192 |
Language |
C++14 (GCC 5.4.1) |
Score |
500 |
Code Size |
1160 Byte |
Status |
AC |
Exec Time |
1 ms |
Memory |
256 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
500 / 500 |
Status |
|
|
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 |
1 ms |
256 KB |
001.txt |
AC |
1 ms |
256 KB |
002.txt |
AC |
1 ms |
256 KB |
003.txt |
AC |
1 ms |
256 KB |
004.txt |
AC |
1 ms |
256 KB |
005.txt |
AC |
1 ms |
256 KB |
006.txt |
AC |
1 ms |
256 KB |
007.txt |
AC |
1 ms |
256 KB |
008.txt |
AC |
1 ms |
256 KB |
009.txt |
AC |
1 ms |
256 KB |
010.txt |
AC |
1 ms |
256 KB |
011.txt |
AC |
1 ms |
256 KB |
012.txt |
AC |
1 ms |
256 KB |
013.txt |
AC |
1 ms |
256 KB |
014.txt |
AC |
1 ms |
256 KB |
015.txt |
AC |
1 ms |
256 KB |
example0.txt |
AC |
1 ms |
256 KB |
example1.txt |
AC |
1 ms |
256 KB |