Submission #1101538
Source Code Expand
#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef pair<int,int>P;
const int MAX_N = 100005;
pair<double,double> cur[3];
int main()
{
double x,y;
rep(i,3){
scanf("%lf%lf",&x,&y);
cur[i].first = x;
cur[i].second = y;
}
double a,b,c;
a = sqrt(pow((cur[0].first-cur[1].first),2) + pow((cur[0].second-cur[1].second),2));
b = sqrt(pow((cur[1].first-cur[2].first),2) + pow((cur[1].second-cur[2].second),2));
c = sqrt(pow((cur[2].first-cur[0].first),2) + pow((cur[2].second-cur[0].second),2));
double nmax = max(a,max(b,c));
double len = a+b+c;
pair<double,double> A,B;
A.first = cur[1].first - cur[0].first;
A.second = cur[1].second - cur[0].second;
B.first = cur[2].first - cur[0].first;
B.second = cur[2].second - cur[0].second;
double S = abs(A.first*B.second-A.second*B.first)/2;
double ans = S/(len/2 + 2*S/nmax);
printf("%.12f\n",ans);
}
Submission Info
Submission Time
2017-02-10 05:42:05+0900
Task
B - Inscribed Bicycle
User
kopricky
Language
C++14 (GCC 5.4.1)
Score
500
Code Size
1008 Byte
Status
AC
Exec Time
3 ms
Memory
256 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:19:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf%lf",&x,&y);
^
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
3 ms
256 KB
001.txt
AC
2 ms
256 KB
002.txt
AC
2 ms
256 KB
003.txt
AC
3 ms
256 KB
004.txt
AC
3 ms
256 KB
005.txt
AC
2 ms
256 KB
006.txt
AC
2 ms
256 KB
007.txt
AC
2 ms
256 KB
008.txt
AC
2 ms
256 KB
009.txt
AC
2 ms
256 KB
010.txt
AC
3 ms
256 KB
011.txt
AC
3 ms
256 KB
012.txt
AC
2 ms
256 KB
013.txt
AC
2 ms
256 KB
014.txt
AC
2 ms
256 KB
015.txt
AC
2 ms
256 KB
example0.txt
AC
2 ms
256 KB
example1.txt
AC
3 ms
256 KB