Submission #1919404
Source Code Expand
#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "unordered_map" #include "iomanip" #include "cmath" #include "random" using namespace std; const long long int MOD = 1000000007; long long int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); vector<long double>edge; vector<long double >x(3); vector<long double >y(3); for (int i = 0; i < 3; i++) { cin >> x[i] >> y[i]; } for (int i = 0; i < 3; i++) { for (int j = i + 1; j < 3; j++) { edge.push_back(sqrt(abs(x[i] - x[j])*abs(x[i] - x[j]) + abs(y[i] - y[j])*abs(y[i] - y[j]))); } } sort(edge.begin(), edge.end()); x[0] = 0; y[0] = 0; x[1] = edge[2]; y[1] = 0; x[2] = (edge[1] * edge[1] + edge[2] * edge[2] - edge[0] * edge[0]) / (edge[2] * 2); y[2] = sqrt(edge[1] * edge[1] - x[2] * x[2]); long double l = 0; long double r = 1000; for (int i = 0; i < 200; i++) { long double mid = (l + r) / 2; if (mid * 2 >= y[2]) { r = mid; continue; } long double w = x[1] * (y[2] - mid) / y[2]; w -= mid*edge[1] / y[2]; w -= mid*edge[0] / y[2]; if (w >= mid * 2) { l = mid; } else { r = mid; } } cout << setprecision(15) << l << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Inscribed Bicycle |
User | olphe |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 1384 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
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 | 1 ms | 256 KB |
001.txt | AC | 1 ms | 256 KB |
002.txt | AC | 1 ms | 256 KB |
003.txt | AC | 1 ms | 256 KB |
004.txt | AC | 1 ms | 256 KB |
005.txt | AC | 1 ms | 256 KB |
006.txt | AC | 1 ms | 256 KB |
007.txt | AC | 1 ms | 256 KB |
008.txt | AC | 1 ms | 256 KB |
009.txt | AC | 1 ms | 256 KB |
010.txt | AC | 1 ms | 256 KB |
011.txt | AC | 1 ms | 256 KB |
012.txt | AC | 1 ms | 256 KB |
013.txt | AC | 1 ms | 256 KB |
014.txt | AC | 1 ms | 256 KB |
015.txt | AC | 1 ms | 256 KB |
example0.txt | AC | 1 ms | 256 KB |
example1.txt | AC | 1 ms | 256 KB |