結果
| 問題 | No.1205 Eye Drops | 
| コンテスト | |
| ユーザー |  poohbear | 
| 提出日時 | 2020-08-30 13:09:38 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 89 ms / 2,000 ms | 
| コード長 | 874 bytes | 
| コンパイル時間 | 2,400 ms | 
| コンパイル使用メモリ | 195,596 KB | 
| 最終ジャッジ日時 | 2025-01-13 20:55:34 | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 37 | 
ソースコード
#include <bits/stdc++.h>
#define rep(a,n) for (int a = 0; a < (n); ++a)
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
typedef vector<vector<ll> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;
int main(){
    ll n,m;
    cin >> n >> m;
    vector<P>que;
    que.push_back({0,0});
    rep(i,m){
        ll t,p;
        cin >>  t >> p;
        que.push_back({t,p});
    }
    bool ans = true;
    rep(i,m){
        ll t_diff =que[i+1].first-que[i].first;
        ll p_diff = abs(que[i+1].second-que[i].second);
        if(t_diff<p_diff)ans=false;
    }
    if(ans){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}
            
            
            
        