結果

問題 No.1205 Eye Drops
ユーザー xRS43BofaUEZ5gc
提出日時 2021-03-03 10:32:06
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 591 bytes
コンパイル時間 3,601 ms
コンパイル使用メモリ 74,748 KB
実行使用メモリ 53,004 KB
最終ジャッジ日時 2024-10-03 03:09:29
合計ジャッジ時間 15,284 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 24 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class HelloWorld {

	    public static void main(String[] args) throws Exception {

	    	Scanner sc = new Scanner(System.in);
	    	String[] str = sc.nextLine().split(" ");
	    	int n = 0;
	    	int m = Integer.parseInt(str[1]);
	    	boolean flag = true;

	    	for (int i = 0; i < m; i ++) {
	    		str = sc.nextLine().split(" ");
	    		if (Integer.parseInt(str[0]) >= n + Integer.parseInt(str[1])) {
	    			n = Integer.parseInt(str[1]);
	    		}else {
	    			flag = false;
	    		}
	    	}

	    	System.out.println(flag ? "Yes" : "No");

	    	}

}
0