結果

問題 No.512 魔法少女の追いかけっこ
ユーザー kazapyon27kazapyon27
提出日時 2017-05-24 01:03:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,088 bytes
コンパイル時間 4,317 ms
コンパイル使用メモリ 75,572 KB
実行使用メモリ 51,932 KB
最終ジャッジ日時 2023-09-09 13:31:07
合計ジャッジ時間 8,228 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
50,248 KB
testcase_01 AC 43 ms
49,600 KB
testcase_02 AC 42 ms
47,964 KB
testcase_03 AC 42 ms
49,720 KB
testcase_04 AC 43 ms
49,812 KB
testcase_05 AC 42 ms
49,848 KB
testcase_06 AC 43 ms
49,972 KB
testcase_07 WA -
testcase_08 AC 42 ms
49,824 KB
testcase_09 AC 42 ms
49,764 KB
testcase_10 AC 42 ms
49,724 KB
testcase_11 AC 43 ms
49,740 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 42 ms
49,544 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 43 ms
49,648 KB
testcase_20 AC 43 ms
49,936 KB
testcase_21 WA -
testcase_22 AC 43 ms
49,640 KB
testcase_23 AC 42 ms
49,540 KB
testcase_24 AC 42 ms
49,720 KB
testcase_25 AC 42 ms
49,744 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 41 ms
49,764 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 42 ms
49,648 KB
testcase_32 AC 42 ms
49,756 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 41 ms
49,860 KB
testcase_36 AC 43 ms
49,848 KB
testcase_37 AC 42 ms
49,864 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 41 ms
49,716 KB
testcase_41 AC 41 ms
49,884 KB
testcase_42 WA -
testcase_43 AC 42 ms
50,064 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 41 ms
49,540 KB
testcase_48 AC 43 ms
49,744 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 41 ms
49,860 KB
testcase_52 AC 41 ms
49,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.512 魔法少女の追いかけっこ*/
import java.io.*;
import java.math.*;
import java.util.*;
public class No512 {
	public static ArrayList<BigDecimal> prepare(String a){
		String []H_a =a.split(" ");
		ArrayList<BigDecimal> al = new ArrayList<BigDecimal>(); 
		for(int i=0;i<H_a.length;i++){
			al.add(new BigDecimal(H_a[i]));
		}
		return al;
	}
	public static void main(String[] args) {
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			ArrayList<BigDecimal> Speed = No512.prepare(input.readLine());
			ArrayList<BigDecimal> Distance = No512.prepare(input.readLine());
			boolean chase=true;
			for(int i=0;i<Distance.size()-1;i++){
				BigDecimal rapTime=Distance.get(i).divide(Speed.get(0),6,RoundingMode.DOWN);
				BigDecimal rapPoint=Speed.get(1).multiply(rapTime).setScale(2, RoundingMode.DOWN);
				if(rapPoint.compareTo(Distance.get(i+1))==1){
					chase=false;
					break;
				}
			}
			if(chase){
				System.out.println("YES");
			}else{
				System.out.println("NO");
			}			
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0