結果

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

ソースコード

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 ll INF=1LL<<60;

int main(){
  int n,m;
  cin>>n>>m;
  vector<ll>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;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