結果

問題 No.98 円を描こう
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-03-01 00:14:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 460 bytes
コンパイル時間 4,580 ms
コンパイル使用メモリ 72,132 KB
実行使用メモリ 56,156 KB
最終ジャッジ日時 2023-08-24 18:08:27
合計ジャッジ時間 6,857 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
55,848 KB
testcase_01 AC 134 ms
55,704 KB
testcase_02 AC 137 ms
55,960 KB
testcase_03 AC 135 ms
55,688 KB
testcase_04 AC 132 ms
55,796 KB
testcase_05 AC 134 ms
56,156 KB
testcase_06 AC 134 ms
56,072 KB
testcase_07 AC 133 ms
55,968 KB
testcase_08 AC 134 ms
55,980 KB
testcase_09 AC 136 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.System.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		double x = sc.nextDouble();
		double y = sc.nextDouble();
		double dist = GetDistance(0,0,x,y);
		int ans = (int)(dist*2+1);
		out.println(ans);
	}
	static double GetDistance (double x1, double y1, double x2, double y2) {
		double d = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		return d;
	}

}
0