Submission #1000782
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; const int M = 10; int x[M], y[M]; int n = 3; ld a[M], sum = 0; ld b[M]; void read() { for (int i = 0; i < n; ++i) { cin >> x[i] >> y[i]; } } ld sq(ld x) { return x * x; } void kill() { for (int i = 0; i < n; ++i) { int j = (i + 1) % n; int dx = x[i] - x[j]; int dy = y[i] - y[j]; a[i] = hypotl(dx, dy); sum += a[i]; } ld ans = 0; for (int i = 0; i < n; ++i) { ld A = a[i]; ld B = a[(i + 1) % n]; ld C = a[(i + 2) % n]; ld b = acosl((sq(A) + sq(C) - sq(B)) / (2 * A * C)); ld c = acosl((sq(A) + sq(B) - sq(C)) / (2 * B * A)); ld sum = 1.0 / tanl(b / 2) + 1.0 / tanl(c / 2) + 2; ld r = A / sum; ans = max(ans, r); } cout << ans << endl; } int main() { #ifdef LOCAL assert(freopen("b.in", "r", stdin)); #endif ios_base::sync_with_stdio(false); cout.precision(13); cout << fixed; read(); kill(); }
Submission Info
Submission Time | |
---|---|
Task | B - Inscribed Bicycle |
User | Arterm |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 1060 Byte |
Status | AC |
Exec Time | 2 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 | 2 ms | 256 KB |
001.txt | AC | 2 ms | 256 KB |
002.txt | AC | 2 ms | 256 KB |
003.txt | AC | 2 ms | 256 KB |
004.txt | AC | 2 ms | 256 KB |
005.txt | AC | 2 ms | 256 KB |
006.txt | AC | 2 ms | 256 KB |
007.txt | AC | 2 ms | 256 KB |
008.txt | AC | 2 ms | 256 KB |
009.txt | AC | 2 ms | 256 KB |
010.txt | AC | 2 ms | 256 KB |
011.txt | AC | 2 ms | 256 KB |
012.txt | AC | 2 ms | 256 KB |
013.txt | AC | 2 ms | 256 KB |
014.txt | AC | 2 ms | 256 KB |
015.txt | AC | 2 ms | 256 KB |
example0.txt | AC | 2 ms | 256 KB |
example1.txt | AC | 2 ms | 256 KB |