結果
| 問題 | No.1205 Eye Drops | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-01-10 20:25:08 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 66 ms / 2,000 ms | 
| コード長 | 752 bytes | 
| コンパイル時間 | 1,567 ms | 
| コンパイル使用メモリ | 166,788 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-21 08:34:07 | 
| 合計ジャッジ時間 | 3,569 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 37 | 
ソースコード
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,s,n) for (int i = (s); i < (n); ++i)
#define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define len(x) (int)(x).size()
#define dup(x,y) (((x)+(y)-1)/(y))
#define pb push_back
#define eb emplace_back
#define Field(T) vector<vector<T>>
#define pq(T) priority_queue<T,vector<T>,greater<T>>
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
  int n, m;
  cin >> n >> m;
  ll x = 0, s = 0;
  rep(i,0,m) {
    ll t, p;
    cin >> t >> p;
    if (abs(x-p) > abs(t-s)) {
      cout << "No" << endl;
      return 0;
    }
    x = p, s = t;
  }
  cout << "Yes" << endl;
  return 0;
}
            
            
            
        