結果

問題 No.98 円を描こう
ユーザー fukuseifukusei
提出日時 2017-05-17 17:19:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 3,508 ms
コンパイル使用メモリ 79,196 KB
実行使用メモリ 57,676 KB
最終ジャッジ日時 2023-10-17 23:57:02
合計ジャッジ時間 5,364 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
55,868 KB
testcase_01 AC 131 ms
57,592 KB
testcase_02 AC 131 ms
57,572 KB
testcase_03 AC 130 ms
57,460 KB
testcase_04 AC 131 ms
57,676 KB
testcase_05 AC 132 ms
57,428 KB
testcase_06 AC 131 ms
57,428 KB
testcase_07 AC 134 ms
57,424 KB
testcase_08 AC 130 ms
57,148 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*; 

public class test {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int x = sc.nextInt();
		int y = sc.nextInt();
		float lng = (float)Math.sqrt(x*x + y*y);

		if(lng > (int)lng){
			int c = (int)Math.ceil(lng) * 2;
			System.out.println(c);
		}
		else{
			int c = (int)lng*2 + 1;
			System.out.println(c);
		}
		
	}
}
0