結果

問題 No.98 円を描こう
ユーザー fukuseifukusei
提出日時 2017-05-17 17:15:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 4,736 ms
コンパイル使用メモリ 74,524 KB
実行使用メモリ 57,660 KB
最終ジャッジ日時 2023-10-17 23:56:52
合計ジャッジ時間 5,550 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
57,536 KB
testcase_01 AC 128 ms
57,544 KB
testcase_02 AC 118 ms
56,204 KB
testcase_03 AC 130 ms
57,552 KB
testcase_04 AC 132 ms
57,648 KB
testcase_05 AC 127 ms
55,444 KB
testcase_06 WA -
testcase_07 AC 130 ms
57,660 KB
testcase_08 AC 131 ms
57,520 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();
		double lng = 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