Submission #3419848
Source Code Expand
#include<cstdio> #include<iostream> #include<algorithm> #include<vector> #include<string> #include<cstdlib> #include<cmath> #include<cstring> #include<set> #include<map> #include<queue> using namespace std; #define rep(i,n) for(int (i)=0;(i)<(n);++i) #define rrep(i,n) for(int (i)=(n)-1;(i)>=0;--i) #define rep1(i,n) for(int (i)=1;(i)<=(n);++i) #define rrep1(i,n) for(int (i)=(n);(i)>=1;--i) #define pb push_back #define fr first #define sc second typedef long long ll; typedef pair<int,int> P; typedef pair<double,double> DP; typedef pair<long long,long long> LP; typedef double db; using namespace std; ll N; DP p[3]; db a,b,c; db dist(DP a,DP b){ return sqrt((a.fr-b.fr)*(a.fr-b.fr)+(a.sc-b.sc)*(a.sc-b.sc)); } db r; db ans; db d; // rd/(2r+d) > x int main() { rep(i,3) cin>>p[i].fr>>p[i].sc; a = dist(p[0],p[1]); b = dist(p[1],p[2]); c = dist(p[2],p[0]); d = max(max(a,b),c); db s = (a+b+c)/2.0; db S = sqrt( s*(s-a)*(s-b)*(s-c) ); r = S/s; printf("%.100f\n",r*d/(2*r+d)); }
Submission Info
Submission Time | |
---|---|
Task | B - Inscribed Bicycle |
User | miyajiro |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 1048 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 |