Submission #1712977
Source Code Expand
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long double lf; pii P[3]; lf A[3]; lf dist(pii a, pii b) { int dx = a.first - b.first; int dy = a.second - b.second; return sqrt(dx*dx + dy*dy); } int main() { for(int i = 0; i < 3; i++) { scanf("%d %d", &P[i].first, &P[i].second); } for(int i = 0; i < 3; i++) { pii v1 = pii(P[(i + 1)%3].first - P[i].first, P[(i + 1)%3].second - P[i].second); pii v2 = pii(P[(i + 2)%3].first - P[i].first, P[(i + 2)%3].second - P[i].second); A[i] = acos(((lf) v1.first * v2.first + (lf) v1.second * v2.second) / dist(P[i], P[(i + 1)%3]) / dist(P[i], P[(i + 2)%3])); } lf ans = 0; for(int i = 0; i < 3; i++) { lf tmp = dist(P[i], P[(i + 1)%3]) / (2 + 1/tan(A[i] / 2) + 1/tan(A[(i + 1)%3] / 2)); ans = max(ans, tmp); } cout<<fixed; cout.precision(20); cout << ans; }
Submission Info
Submission Time | |
---|---|
Task | B - Inscribed Bicycle |
User | choikiwon |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 978 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:18:50: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &P[i].first, &P[i].second); ^
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 |