結果

問題 No.1205 Eye Drops
ユーザー kaede2020
提出日時 2020-09-01 20:44:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 791 bytes
コンパイル時間 1,665 ms
コンパイル使用メモリ 167,948 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 21:02:13
合計ジャッジ時間 3,096 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long 
typedef pair<ll, ll> P;
//const int MAX=10100;
const ll INF=1LL<<60;

int main(){
  int n,m;
  cin>>n>>m;
  vector<int>t(n),p(n);
  rep(i,m)cin>>t[i]>>p[i];
  rep(i,m){
    if(t[i]<p[i]){
      cout<<"No"<<endl;
      return 0;
    }
  }
  int jikan=0;
  int kusuri=0;
  for(int i=1;i<m-1;i++){
    jikan=t[i]-t[i-1];
    kusuri=abs(p[i]-p[i-1]);
    if(jikan<kusuri){
      cout<<"No"<<endl;
      return 0;
    }


  }
  cout<<"Yes"<<endl;
  return 0;
}
  
0