Submission #1101537


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].second;
	A.second = cur[1].second - cur[0].second;
	B.first = cur[2].first - cur[0].second;
	B.second = cur[2].second - cur[0].second;
	double cosac,sinac;
	cosac = (A.first*B.first+A.second*B.second)/(a*c);
	sinac = sqrt(1-pow(cosac,2));
	double S = a*c*sinac/2.0;
	double ans = S/(len/2 + 2*S/nmax);
	printf("%.12f\n",ans);
}

Submission Info

Submission Time
Task B - Inscribed Bicycle
User kopricky
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1090 Byte
Status WA
Exec Time 4 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 0 / 500
Status
AC × 1
WA × 1
AC × 2
WA × 16
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 WA 4 ms 256 KB
002.txt WA 3 ms 256 KB
003.txt WA 3 ms 256 KB
004.txt WA 3 ms 256 KB
005.txt WA 3 ms 256 KB
006.txt WA 3 ms 256 KB
007.txt WA 3 ms 256 KB
008.txt WA 3 ms 256 KB
009.txt WA 3 ms 256 KB
010.txt WA 3 ms 256 KB
011.txt WA 3 ms 256 KB
012.txt WA 3 ms 256 KB
013.txt WA 3 ms 256 KB
014.txt WA 3 ms 256 KB
015.txt WA 3 ms 256 KB
example0.txt AC 3 ms 256 KB
example1.txt WA 3 ms 256 KB