結果

問題 No.1178 Can you draw a Circle?
ユーザー ApassApass
提出日時 2020-08-21 22:56:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 1,199 bytes
コンパイル時間 3,777 ms
コンパイル使用メモリ 77,604 KB
実行使用メモリ 37,244 KB
最終ジャッジ日時 2024-04-25 04:14:32
合計ジャッジ時間 4,876 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
36,968 KB
testcase_01 AC 53 ms
37,068 KB
testcase_02 AC 51 ms
37,244 KB
testcase_03 AC 53 ms
37,136 KB
testcase_04 AC 51 ms
37,172 KB
testcase_05 AC 50 ms
36,596 KB
testcase_06 AC 51 ms
36,944 KB
testcase_07 AC 51 ms
37,204 KB
testcase_08 AC 50 ms
37,044 KB
testcase_09 AC 51 ms
36,836 KB
testcase_10 AC 53 ms
37,156 KB
testcase_11 AC 52 ms
36,820 KB
testcase_12 AC 52 ms
37,032 KB
testcase_13 AC 53 ms
37,068 KB
testcase_14 AC 51 ms
37,000 KB
testcase_15 AC 52 ms
36,696 KB
testcase_16 AC 51 ms
36,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.awt.*;
import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.stream.IntStream;

public class D_CanYouDrawACircle {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static final PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    private static StringTokenizer st;

    private static int readInt() throws IOException {
        while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return Integer.parseInt(st.nextToken());
    }

    public static void main(String[] args) throws IOException {
        solve();
        pw.close();
    }

    private static void solve() throws IOException {
        double a = readInt();
        double b = readInt();   
        double c = readInt();
        double d = readInt();
        double e = readInt();
        double f = readInt();

        assert a == b;
        // a x 2 + b y 2 + c x + d y + e = f
        // r * r = (f-e-4 * c * c/a - 4 * d * d/b)/a
        double r = Math.sqrt((f - e + c * c / a / 4 + d * d / b / 4) / a);
        pw.println(r);
    }

}

0