結果

問題 No.98 円を描こう
ユーザー koukonkokoukonko
提出日時 2015-12-11 17:09:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 1,953 ms
コンパイル使用メモリ 70,976 KB
実行使用メモリ 49,516 KB
最終ジャッジ日時 2023-10-13 10:55:57
合計ジャッジ時間 3,158 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,508 KB
testcase_01 AC 43 ms
49,264 KB
testcase_02 AC 43 ms
49,424 KB
testcase_03 AC 43 ms
49,412 KB
testcase_04 AC 43 ms
49,416 KB
testcase_05 AC 42 ms
49,344 KB
testcase_06 WA -
testcase_07 AC 44 ms
49,228 KB
testcase_08 AC 44 ms
49,516 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

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;

			while(true){
				if(i * i >= z){
					if(i * i == z){
						i *= 2;
						++i;
					}else{
						i *= 2;
					}
					break;
				}
				++i;
			}

			System.out.println(i);

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