Submission #1000908
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using D = double;
using uint = unsigned int;
#ifdef WIN32
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define y1 y1_dsf
int x1, y1, x2, y2, x3, y3;
inline ld getd(int x1, int y1, int x2, int y2)
{
// cout << (ld)(x1 - x2) * (x1 - x2) << ' ' << (ld)(y1 - y2) << ' ' << (y1 - y2) << endl;
return sqrt((ld)(x1 - x2) * (x1 - x2) + (ld)(y1 - y2) * (y1 - y2));
}
int main()
{
scanf("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &x3, &y3);
ld a = getd(x1, y1, x2, y2);
ld b = getd(x2, y2, x3, y3);
ld c = getd(x3, y3, x1, y1);
// cout << a << ' ' << b << ' ' << c << endl;
if (a < b) swap(a, b);
if (a < c) swap(a, c);
ld al = acos((a * a + c * c - b * b) / (2 * a * c));
ld be = acos((a * a + b * b - c * c) / (2 * a * b));
// cout << a << ' ' << b << ' ' << c << endl;
// cout << al << ' ' << be << endl;
ld x = a / (2 + 1 / tan(al / 2) + 1 / tan(be / 2));
cout.precision(20);
cout << x << endl;
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Inscribed Bicycle |
User |
KAN |
Language |
C++14 (GCC 5.4.1) |
Score |
500 |
Code Size |
1240 Byte |
Status |
AC |
Exec Time |
3 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:34:56: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &x3, &y3);
^
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 |
3 ms |
256 KB |
002.txt |
AC |
3 ms |
256 KB |
003.txt |
AC |
3 ms |
256 KB |
004.txt |
AC |
3 ms |
256 KB |
005.txt |
AC |
3 ms |
256 KB |
006.txt |
AC |
3 ms |
256 KB |
007.txt |
AC |
3 ms |
256 KB |
008.txt |
AC |
3 ms |
256 KB |
009.txt |
AC |
3 ms |
256 KB |
010.txt |
AC |
3 ms |
256 KB |
011.txt |
AC |
3 ms |
256 KB |
012.txt |
AC |
3 ms |
256 KB |
013.txt |
AC |
3 ms |
256 KB |
014.txt |
AC |
3 ms |
256 KB |
015.txt |
AC |
3 ms |
256 KB |
example0.txt |
AC |
3 ms |
256 KB |
example1.txt |
AC |
3 ms |
256 KB |