Submission #1000749
Source Code Expand
#include <iostream> #include <fstream> #include <set> #include <map> #include <string> #include <vector> #include <bitset> #include <algorithm> #include <cstring> #include <cstdlib> #include <cmath> #include <cassert> #include <queue> #define mp make_pair #define pb push_back typedef long long ll; typedef long double ld; using namespace std; struct point { ld x, y; point(ld X = 0, ld Y = 0) { x = X, y = Y; } point operator-(point a) { return point(x - a.x, y - a.y); } point operator+(point a) { return point(x + a.x, y + a.y); } ld len() { return sqrt(x * x + y * y); } ld operator^(point a) { return x * a.x + y * a.y; } ld operator*(point a) { return x * a.y - y * a.x; } }; point nm(point a) { ld l = a.len(); a.x /= l; a.y /= l; return a; } ld get(point a, point b, point c, ld r) { a = a - b; c = c - b; a = nm(a); c = nm(c); c = a + c; return r * (a ^ c) / (a * c); } point pp[100]; int main() { for (int i = 0; i < 3; ++i) cin >> pp[i].x >> pp[i].y; pp[3] = pp[0]; pp[4] = pp[1]; pp[5] = pp[2]; ld l = 0; ld r = 5000; for (int it = 0; it < 3000; ++it) { ld m = (l + r) / 2; int fl = 0; for (int i = 1; i <= 3; ++i) { if (get(pp[i - 1], pp[i], pp[i + 1], m) + 2 * m + get(pp[i], pp[i + 1], pp[i + 2], m) <= (pp[i + 1] - pp[i]).len()) fl = 1; } if (fl) l = m; else r = m; } cout.setf(ios::fixed); cout.precision(20); cout << l << "\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Inscribed Bicycle |
User | LHiC |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1533 Byte |
Status | WA |
Exec Time | 4 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 | AC | 3 ms | 256 KB |
002.txt | WA | 3 ms | 256 KB |
003.txt | AC | 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 | AC | 4 ms | 256 KB |
010.txt | WA | 3 ms | 256 KB |
011.txt | AC | 3 ms | 256 KB |
012.txt | WA | 3 ms | 256 KB |
013.txt | AC | 3 ms | 256 KB |
014.txt | WA | 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 |