Submission #1014679
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int, int> Point; int main() { //ifstream cin("testB.in"); vector<Point> v(3); for(int i = 0; i < 3; ++i) cin >> v[i].x >> v[i].y; auto getDist = [] (Point A, Point B) { return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y)); }; double per = 0, area = 0, maxDist = 0; for(int i = 0; i < 3; ++i) { double d = getDist(v[i], v[(i + 1) % 3]); per += d; maxDist = max(maxDist, d); } for(int i = 0; i < 3; ++i) { area += v[i].x * v[(i + 1) % 3].y; area -= v[i].y * v[(i + 1) % 3].x; } area /= 2; double r = area / (per / 2); double ans = 0; if(fabs(2 * r - maxDist) > 1e9) ans = (r * maxDist) / (2 * r - maxDist); else ans = (r * r) / (r + 1); cout.precision(15); cout << ans << "\n"; }
Submission Info
Submission Time | |
---|---|
Task | B - Inscribed Bicycle |
User | mcalancea |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 985 Byte |
Status | WA |
Exec Time | 3 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 3 ms | 256 KB |
001.txt | WA | 3 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 |