結果

問題 No.98 円を描こう
ユーザー koukonkokoukonko
提出日時 2015-12-11 17:42:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 710 bytes
コンパイル時間 2,555 ms
コンパイル使用メモリ 71,104 KB
実行使用メモリ 49,408 KB
最終ジャッジ日時 2023-10-13 10:57:37
合計ジャッジ時間 3,945 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,272 KB
testcase_01 AC 45 ms
49,136 KB
testcase_02 AC 43 ms
49,300 KB
testcase_03 AC 43 ms
49,408 KB
testcase_04 AC 42 ms
49,344 KB
testcase_05 AC 43 ms
48,976 KB
testcase_06 AC 43 ms
49,264 KB
testcase_07 AC 43 ms
49,204 KB
testcase_08 AC 44 ms
49,112 KB
testcase_09 AC 44 ms
49,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			String[] box = buff.readLine().split(" ");

			int x = Integer.parseInt(box[0]);
			int y = Integer.parseInt(box[1]);

			int z = x * x + y * y;

			int i = 0;

			i = (int) Math.round(Math.sqrt(z));

			if(i * i <= z){
				i *= 2;
				++i;
			}else{
				i *= 2;
			}

			System.out.println(i);

		} catch (NumberFormatException e) {
			e.getStackTrace();
		} catch (IOException e) {
			e.getStackTrace();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0