結果

問題 No.1205 Eye Drops
ユーザー seven_threeseven_three
提出日時 2020-08-30 13:14:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 623 bytes
コンパイル時間 887 ms
コンパイル使用メモリ 91,072 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 20:43:30
合計ジャッジ時間 2,287 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	long long n, m;
	cin >> n >> m;
	long long now = 0, now1 = 0;
	for (int i = 0; i < m; i++) {
		long long t, p;
		cin >> t >> p;
		t -= now;
		long long l = now1 - t;
		long long r = now1 + t;
		if (l > p || r < p) {
			cout << "No" << endl;
			return 0;
		}
		now = t;
		now1 = p;
	}
	cout << "Yes" << endl;
	return 0;
}
0