結果

問題 No.172 UFOを捕まえろ
ユーザー 37zigen37zigen
提出日時 2016-03-31 17:35:54
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 553 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 74,676 KB
実行使用メモリ 54,440 KB
最終ジャッジ日時 2024-04-17 18:33:59
合計ジャッジ時間 6,211 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,800 KB
testcase_01 AC 139 ms
41,968 KB
testcase_02 AC 136 ms
41,624 KB
testcase_03 AC 146 ms
41,600 KB
testcase_04 AC 137 ms
41,636 KB
testcase_05 AC 137 ms
41,540 KB
testcase_06 AC 138 ms
41,792 KB
testcase_07 AC 125 ms
41,644 KB
testcase_08 AC 140 ms
41,652 KB
testcase_09 AC 139 ms
41,932 KB
testcase_10 AC 137 ms
41,736 KB
testcase_11 AC 139 ms
41,704 KB
testcase_12 AC 142 ms
41,536 KB
testcase_13 AC 137 ms
41,492 KB
testcase_14 AC 125 ms
41,524 KB
testcase_15 AC 138 ms
41,704 KB
testcase_16 AC 138 ms
41,756 KB
testcase_17 AC 138 ms
41,576 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 141 ms
41,672 KB
testcase_21 AC 134 ms
41,620 KB
testcase_22 AC 125 ms
41,432 KB
testcase_23 AC 135 ms
41,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder172;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		double[] xx={1,-1,0,0,1.4141356/2,-1.4141356/2,1.4141356/2,-1.4141356/2};
		double[] yy={0,0,1,-1,1.4141356/2,-1.4141356/2,-1.4141356/2,1.4141356/2};
		
		Scanner sc=new Scanner(System.in);
		double x=sc.nextDouble();
		double y=sc.nextDouble();
		double r=sc.nextDouble();
		double len=0;
		for(int i=0;i<8;i++){
			len=Math.max(Math.ceil((Math.abs(0.001+x+xx[i]*r)+Math.abs(0.001+y+yy[i]*r))),len);
		}
		System.out.println((int)len);
	}
}
0