結果

問題 No.98 円を描こう
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-03-31 18:24:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 5,000 ms
コード長 378 bytes
コンパイル時間 3,414 ms
コンパイル使用メモリ 74,896 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2024-04-10 06:50:15
合計ジャッジ時間 4,037 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
54,260 KB
testcase_01 AC 136 ms
54,316 KB
testcase_02 AC 137 ms
54,120 KB
testcase_03 AC 144 ms
56,348 KB
testcase_04 AC 136 ms
54,520 KB
testcase_05 AC 137 ms
54,268 KB
testcase_06 AC 137 ms
54,144 KB
testcase_07 AC 139 ms
54,204 KB
testcase_08 AC 137 ms
54,356 KB
testcase_09 AC 124 ms
53,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		double x_p = in.nextDouble();
		double y_p = in.nextDouble();

		int ans = 0;
		x_p = Math.abs(x_p);
		y_p = Math.abs(y_p);
		double r = Math.sqrt(Math.pow(x_p,2) + Math.pow(y_p,2));
		ans = (int)(r*2) + 1;
		System.out.println(ans);
	}
}
0