結果

問題 No.98 円を描こう
ユーザー jimanojimano
提出日時 2018-01-28 17:16:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 3,026 ms
コンパイル使用メモリ 71,700 KB
実行使用メモリ 49,456 KB
最終ジャッジ日時 2023-08-28 13:53:00
合計ジャッジ時間 4,183 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,228 KB
testcase_01 AC 42 ms
49,348 KB
testcase_02 AC 42 ms
47,324 KB
testcase_03 AC 42 ms
49,260 KB
testcase_04 AC 41 ms
49,268 KB
testcase_05 AC 42 ms
49,456 KB
testcase_06 AC 42 ms
49,408 KB
testcase_07 AC 42 ms
49,060 KB
testcase_08 AC 43 ms
49,336 KB
testcase_09 AC 42 ms
49,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1_5;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0098 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String[] str = br.readLine().split(" ");
			int x = Integer.parseInt(str[0]);
			int y = Integer.parseInt(str[1]);
			double dist = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));// 原点からの距離
			
			System.out.println((int)(dist * 2 + 1));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0