Submission #1000617


Source Code Expand

#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;

int main() {
    double x[3], y[3];
    for (int i = 0; i < 3; i++) {
        scanf("%lf %lf", &x[i], &y[i]);
    }
    double S[3], ang[3];
    for (int i = 0; i < 3; i++) {
        S[i] = hypot(x[(i + 1) % 3] - x[(i + 2) % 3], y[(i + 1) % 3] - y[(i + 2) % 3]);
        double vx = (x[(i + 1) % 3] - x[i]), vy = (y[(i + 1) % 3] - y[i]);
        double ux = (x[(i + 2) % 3] - x[i]), uy = (y[(i + 2) % 3] - y[i]);
        ang[i] = fabs(atan2(vx * uy - ux * vy, vx * ux + vy * uy));
    }
    double ans = 0;
    for (int i = 0; i < 3; i++) {
        ans = max(ans, S[i] / (2 + 1.0 / atan(ang[(i + 1) % 3] / 2) + 1.0 / atan(ang[(i + 2) % 3] / 2)));
    }
    printf("%.10lf\n", ans);
}

Submission Info

Submission Time
Task B - Inscribed Bicycle
User Zlobober
Language C++14 (GCC 5.4.1)
Score 0
Code Size 785 Byte
Status WA
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:39: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lf %lf", &x[i], &y[i]);
                                       ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
WA × 2
WA × 18
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 1 ms 128 KB
001.txt WA 1 ms 128 KB
002.txt WA 1 ms 128 KB
003.txt WA 1 ms 128 KB
004.txt WA 1 ms 128 KB
005.txt WA 1 ms 128 KB
006.txt WA 1 ms 128 KB
007.txt WA 1 ms 128 KB
008.txt WA 1 ms 128 KB
009.txt WA 1 ms 128 KB
010.txt WA 1 ms 128 KB
011.txt WA 1 ms 128 KB
012.txt WA 1 ms 128 KB
013.txt WA 1 ms 128 KB
014.txt WA 1 ms 128 KB
015.txt WA 1 ms 128 KB
example0.txt WA 1 ms 128 KB
example1.txt WA 1 ms 128 KB