結果

問題 No.1205 Eye Drops
ユーザー Shawn stayC
提出日時 2021-08-30 23:29:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 1,994 ms
コンパイル使用メモリ 201,132 KB
最終ジャッジ日時 2025-01-24 04:11:46
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i=(l);i<(r);++i)
typedef long long ll;

int main(){
	int n,m; cin>>n>>m;
	vector<pair<int,int>> vp;
	rep(i,0,m){int a,b;cin>>a>>b;vp.emplace_back(a,b);}
	sort(vp.begin(),vp.end());
	int p=0,t=0;
	rep(i,0,m){
		if(abs(p-vp[i].second)>vp[i].first-t){
			cout<<"No"<<endl; return 0;
		}
		p=vp[i].second; t=vp[i].first;
	}
	cout<<"Yes"<<endl;
}
0