結果
| 問題 | No.1205 Eye Drops | 
| コンテスト | |
| ユーザー |  mmn15277198 | 
| 提出日時 | 2020-09-01 20:56:14 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 72 ms / 2,000 ms | 
| コード長 | 635 bytes | 
| コンパイル時間 | 975 ms | 
| コンパイル使用メモリ | 99,008 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-23 21:02:25 | 
| 合計ジャッジ時間 | 2,762 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 37 | 
ソースコード
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
using namespace std;
int main(){
	
	long long n,m;
	cin >> n >> m;
	vector<pair<long long,long long>> pa(m+1);
	
	pa[0].first = pa[0].second = 0;
	
	for(int i=1;i<=m;i++){
		long long t,p;
		cin >> t >> p;
		pa[i].first=t;
		pa[i].second=p;
	}
	
	sort(pa.begin(),pa.end());
	
	for(int i=1;i<=m;i++){
		if(pa[i].first - pa[i-1].first < abs(pa[i].second - pa[i-1].second)){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	
	return 0;
}
            
            
            
        