結果

問題 No.1205 Eye Drops
コンテスト
ユーザー mo3tthi
提出日時 2020-08-30 13:35:46
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 792 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,728 ms
コンパイル使用メモリ 178,624 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-17 13:21:23
合計ジャッジ時間 5,742 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n,m;
  cin>>n>>m;
  int prev=0;
  int prevtime=0;
  rep(i,m){
    int t,p;
    cin>>t>>p;
    if(abs(prev-p) > abs(t-prevtime)){
      cout<<"No"<<endl;
      return 0;
    }else{
      prev=p;
      prevtime=t;
    }
  }
  cout<<"Yes"<<endl;


  return 0;
}
0