結果

問題 No.1205 Eye Drops
ユーザー ks2mks2m
提出日時 2020-08-30 13:04:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 755 bytes
コンパイル時間 1,787 ms
コンパイル使用メモリ 75,144 KB
実行使用メモリ 48,180 KB
最終ジャッジ日時 2024-05-03 00:43:41
合計ジャッジ時間 6,640 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
37,060 KB
testcase_01 AC 47 ms
36,544 KB
testcase_02 AC 55 ms
37,084 KB
testcase_03 AC 56 ms
36,800 KB
testcase_04 AC 52 ms
36,800 KB
testcase_05 AC 77 ms
38,228 KB
testcase_06 AC 57 ms
37,608 KB
testcase_07 AC 56 ms
36,948 KB
testcase_08 AC 68 ms
38,088 KB
testcase_09 AC 84 ms
38,068 KB
testcase_10 AC 77 ms
37,940 KB
testcase_11 AC 67 ms
37,680 KB
testcase_12 AC 68 ms
37,916 KB
testcase_13 AC 50 ms
37,180 KB
testcase_14 AC 78 ms
37,992 KB
testcase_15 AC 55 ms
37,404 KB
testcase_16 AC 50 ms
37,192 KB
testcase_17 AC 81 ms
38,376 KB
testcase_18 AC 54 ms
37,224 KB
testcase_19 AC 68 ms
37,756 KB
testcase_20 AC 60 ms
36,844 KB
testcase_21 AC 70 ms
38,192 KB
testcase_22 AC 64 ms
37,668 KB
testcase_23 AC 55 ms
37,296 KB
testcase_24 AC 70 ms
37,860 KB
testcase_25 AC 80 ms
38,024 KB
testcase_26 AC 71 ms
38,244 KB
testcase_27 AC 55 ms
37,260 KB
testcase_28 AC 51 ms
37,140 KB
testcase_29 AC 57 ms
37,660 KB
testcase_30 AC 72 ms
37,960 KB
testcase_31 AC 55 ms
37,348 KB
testcase_32 AC 313 ms
47,788 KB
testcase_33 AC 284 ms
48,036 KB
testcase_34 AC 278 ms
47,368 KB
testcase_35 AC 291 ms
47,912 KB
testcase_36 AC 283 ms
48,180 KB
testcase_37 AC 275 ms
47,096 KB
testcase_38 AC 46 ms
36,996 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