結果
問題 | No.1178 Can you draw a Circle? |
ユーザー |
![]() |
提出日時 | 2020-08-21 22:56:53 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 1,199 bytes |
コンパイル時間 | 5,801 ms |
コンパイル使用メモリ | 77,556 KB |
実行使用メモリ | 37,208 KB |
最終ジャッジ日時 | 2024-11-07 14:09:40 |
合計ジャッジ時間 | 5,407 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
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); } }