結果

問題 No.98 円を描こう
ユーザー jimano
提出日時 2018-01-28 17:16:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 3,578 ms
コンパイル使用メモリ 75,124 KB
実行使用メモリ 50,404 KB
最終ジャッジ日時 2024-12-29 14:25:21
合計ジャッジ時間 5,123 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

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