Submission #11382672
Source Code Expand
#include <bits/stdc++.h> #include <string> #define ft first #define sc second #define pt(sth) cout << sth << "\n" #define chmax(a, b) (a)=max(a, b); #define chmin(a, b) (a)=min(a, b); #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair<ll, ll> pll; static const ll INF=1e18; static const ll MAX=101010; static const ll MOD=1e9+7; /* for(i=0; i<N; i++) cin >> a[i]; */ int main(void) { ll i, j, k; double x[3], y[3]; for(i=0; i<3; i++) cin >> x[i] >> y[i]; double d[3]; for(i=0; i<3; i++) { double tx=abs(x[i]-x[(i+1)%3]); double ty=abs(y[i]-y[(i+1)%3]); d[i]=sqrt(tx*tx+ty*ty); } double a=max({d[0], d[1], d[2]}); double x0=x[0]-x[2], y0=y[0]-y[2]; double x1=x[1]-x[2], y1=y[1]-y[2]; double S=abs(x0*y1-x1*y0)/2; double r=S*2/(d[0]+d[1]+d[2]); double ans=r*a/(r*2+a); printf("%.12f\n", ans); }
Submission Info
Submission Time | |
---|---|
Task | B - Inscribed Bicycle |
User | eQe |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 955 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 |