Submission #11381963


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 tanhfA[i];
  for(i=0; i<3; i++) {
    double a=d[i];
    double b=d[(i+1)%3];
    double c=d[(i+2)%3];
    double cosA=(b*b+c*c-a*a)/(2*b*c);
    tanhfA[i]=sqrt((1-cosA)/(1+cosA));
  }
  
  double ans=0;
  for(i=0; i<3; i++)
    chmax(ans, d[i]/(1/tanhfA[(i+1)%3]+2+1/tanhfA[(i+2)%3]));
  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 1053 Byte
Status AC
Exec Time 2 ms
Memory 256 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 2 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 2 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