Submission #1005270
Source Code Expand
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if(x < y) x = y; }
int main() {
int x1; int y1;
while(~scanf("%d%d", &x1, &y1)) {
int x2; int y2;
scanf("%d%d", &x2, &y2);
int x3; int y3;
scanf("%d%d", &x3, &y3);
double a = hypot(x1 - x2, y1 - y2);
double b = hypot(x2 - x3, y2 - y3);
double c = hypot(x3 - x1, y3 - y1);
double s = (a + b + c) / 2;
double r = sqrt((s - a) * (s - b) * (s - c) / s);
double lo = 0, up = r;
rep(k, 64) {
double x = (lo + up) / 2;
if((1 - x / r) * max({ a, b, c }) >= 2 * x)
lo = x;
else
up = x;
}
printf("%.10f\n", (lo + up) / 2);
}
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Inscribed Bicycle |
User |
anta |
Language |
C++14 (GCC 5.4.1) |
Score |
500 |
Code Size |
1171 Byte |
Status |
AC |
Exec Time |
3 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:15:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &x2, &y2);
^
./Main.cpp:17:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &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 |