結果

問題 No.1205 Eye Drops
ユーザー ks2mks2m
提出日時 2020-08-30 13:04:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 755 bytes
コンパイル時間 2,680 ms
コンパイル使用メモリ 70,952 KB
実行使用メモリ 57,872 KB
最終ジャッジ日時 2023-08-15 13:12:42
合計ジャッジ時間 8,061 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,428 KB
testcase_01 AC 38 ms
49,616 KB
testcase_02 AC 52 ms
49,544 KB
testcase_03 AC 48 ms
49,828 KB
testcase_04 AC 46 ms
49,416 KB
testcase_05 AC 70 ms
51,204 KB
testcase_06 AC 49 ms
49,468 KB
testcase_07 AC 56 ms
50,000 KB
testcase_08 AC 65 ms
51,364 KB
testcase_09 AC 69 ms
51,452 KB
testcase_10 AC 73 ms
51,628 KB
testcase_11 AC 57 ms
50,656 KB
testcase_12 AC 60 ms
51,228 KB
testcase_13 AC 45 ms
49,332 KB
testcase_14 AC 61 ms
51,640 KB
testcase_15 AC 49 ms
50,012 KB
testcase_16 AC 43 ms
49,512 KB
testcase_17 AC 69 ms
51,548 KB
testcase_18 AC 42 ms
49,308 KB
testcase_19 AC 56 ms
50,372 KB
testcase_20 AC 54 ms
49,360 KB
testcase_21 AC 72 ms
51,352 KB
testcase_22 AC 53 ms
50,244 KB
testcase_23 AC 49 ms
50,000 KB
testcase_24 AC 54 ms
51,100 KB
testcase_25 AC 72 ms
50,504 KB
testcase_26 AC 56 ms
51,232 KB
testcase_27 AC 49 ms
50,108 KB
testcase_28 AC 49 ms
49,216 KB
testcase_29 AC 56 ms
49,952 KB
testcase_30 AC 57 ms
51,036 KB
testcase_31 AC 51 ms
49,520 KB
testcase_32 AC 266 ms
57,636 KB
testcase_33 AC 268 ms
57,872 KB
testcase_34 AC 271 ms
57,176 KB
testcase_35 AC 269 ms
57,660 KB
testcase_36 AC 285 ms
57,680 KB
testcase_37 AC 263 ms
57,328 KB
testcase_38 AC 38 ms
49,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
//		int n = Integer.parseInt(sa[0]);
		int m = Integer.parseInt(sa[1]);
		long[] t = new long[m];
		int[] p = new int[m];
		for (int i = 0; i < m; i++) {
			sa = br.readLine().split(" ");
			t[i] = Long.parseLong(sa[0]);
			p[i] = Integer.parseInt(sa[1]);
		}
		br.close();

		long nt = 0;
		long np = 0;
		for (int i = 0; i < m; i++) {
			if (t[i] - nt < Math.abs(p[i] - np)) {
				System.out.println("No");
				return;
			}
			nt = t[i];
			np = p[i];
		}
		System.out.println("Yes");
	}
}
0