結果

問題 No.98 円を描こう
ユーザー spaciaspacia
提出日時 2015-12-20 14:37:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 568 bytes
コンパイル時間 4,150 ms
コンパイル使用メモリ 75,120 KB
実行使用メモリ 53,524 KB
最終ジャッジ日時 2023-10-17 14:26:31
合計ジャッジ時間 3,376 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
53,508 KB
testcase_01 AC 54 ms
53,504 KB
testcase_02 AC 54 ms
53,496 KB
testcase_03 AC 53 ms
53,504 KB
testcase_04 AC 52 ms
52,416 KB
testcase_05 AC 53 ms
53,504 KB
testcase_06 AC 52 ms
53,500 KB
testcase_07 AC 54 ms
53,524 KB
testcase_08 AC 54 ms
53,500 KB
testcase_09 AC 52 ms
53,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main98 {
	
	public static void out (Object out) {
		System.out.println(out);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		double x = Math.abs(Integer.parseInt(line[0]));
		double y = Math.abs(Integer.parseInt(line[1]));
		double d = Math.sqrt(x * x + y * y);
		double sub = d - (int)d;
		
		out(sub < .5 ? (int)d * 2 + 1 : ((int)d + 1) * 2);
		
	}
}
0