結果

問題 No.1205 Eye Drops
ユーザー Ryo MiyagiRyo Miyagi
提出日時 2020-09-21 18:01:44
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 719 bytes
コンパイル時間 2,034 ms
コンパイル使用メモリ 73,176 KB
実行使用メモリ 71,272 KB
最終ジャッジ日時 2023-09-06 17:23:51
合計ジャッジ時間 14,605 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,100 KB
testcase_01 AC 121 ms
55,452 KB
testcase_02 AC 191 ms
56,272 KB
testcase_03 AC 178 ms
55,996 KB
testcase_04 AC 187 ms
56,124 KB
testcase_05 AC 204 ms
59,048 KB
testcase_06 AC 190 ms
56,404 KB
testcase_07 AC 190 ms
56,280 KB
testcase_08 AC 200 ms
59,188 KB
testcase_09 AC 205 ms
59,712 KB
testcase_10 AC 198 ms
59,460 KB
testcase_11 AC 197 ms
57,192 KB
testcase_12 AC 194 ms
59,504 KB
testcase_13 AC 173 ms
53,896 KB
testcase_14 AC 205 ms
58,740 KB
testcase_15 AC 191 ms
56,328 KB
testcase_16 AC 156 ms
56,068 KB
testcase_17 AC 202 ms
59,692 KB
testcase_18 AC 151 ms
55,584 KB
testcase_19 AC 197 ms
58,484 KB
testcase_20 AC 188 ms
56,256 KB
testcase_21 AC 202 ms
59,068 KB
testcase_22 AC 195 ms
56,304 KB
testcase_23 AC 189 ms
56,116 KB
testcase_24 AC 194 ms
56,932 KB
testcase_25 AC 202 ms
59,492 KB
testcase_26 AC 197 ms
59,232 KB
testcase_27 AC 189 ms
55,940 KB
testcase_28 AC 183 ms
56,220 KB
testcase_29 AC 187 ms
57,096 KB
testcase_30 AC 202 ms
59,576 KB
testcase_31 AC 191 ms
56,552 KB
testcase_32 AC 876 ms
71,016 KB
testcase_33 AC 849 ms
69,976 KB
testcase_34 AC 851 ms
71,100 KB
testcase_35 AC 834 ms
71,272 KB
testcase_36 AC 862 ms
71,164 KB
testcase_37 RE -
testcase_38 AC 125 ms
56,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int range = sc.nextInt();
		int infoNum = sc.nextInt();
		Map<Integer, Integer> info = new TreeMap<>();
		for (int i = 0; i < infoNum;) {
			info.put(sc.nextInt(), sc.nextInt());
			i++;
		}
		int key1 = 0;
		int value1 = 0;
		int key2 = 0;
		int value2 = 0;
		String judgement = "Yes";
		for(Integer key : info.keySet()) {
			key2 = key;
			value2 = info.get(key);
			if(Math.abs(key2 - key1) < Math.abs(value2 - value1)) {
				judgement = "No";
				break;
			}
			key1 = key2;
			value1 = value2;
		}
		System.out.println(judgement);
	}
}
0