結果

問題 No.98 円を描こう
ユーザー kou6839kou6839
提出日時 2014-12-12 15:54:47
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 433 bytes
コンパイル時間 2,067 ms
コンパイル使用メモリ 72,020 KB
実行使用メモリ 56,028 KB
最終ジャッジ日時 2023-09-02 14:22:39
合計ジャッジ時間 4,409 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,432 KB
testcase_01 AC 125 ms
55,592 KB
testcase_02 AC 124 ms
56,028 KB
testcase_03 AC 129 ms
55,924 KB
testcase_04 AC 126 ms
55,864 KB
testcase_05 AC 124 ms
55,816 KB
testcase_06 WA -
testcase_07 AC 126 ms
55,724 KB
testcase_08 AC 127 ms
55,376 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        int temp = (int)(Math.ceil(Math.sqrt(x*x*1.0+y*y*1.0)));
        if(temp*temp==x*x+y*y){
        	System.out.println(temp*2+1);
        }else{
        	System.out.println(temp*2);
        }
    }
}	
0