結果
| 問題 | No.1205 Eye Drops | 
| コンテスト | |
| ユーザー |  K_Meraq6 | 
| 提出日時 | 2020-11-02 16:59:26 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 15 ms / 2,000 ms | 
| コード長 | 445 bytes | 
| コンパイル時間 | 513 ms | 
| コンパイル使用メモリ | 63,104 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-22 06:22:42 | 
| 合計ジャッジ時間 | 1,784 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 37 | 
ソースコード
#include <iostream>
using namespace std;
int main() {
    int n, m; cin >> n >> m;
    int now = 0, place = 0;
    bool c = 1;
    for(int i = 0; i < m; ++i) {
        int t, p; cin >> t >> p;
        if(max(t - now, now - t) < max(p - place, place - p)) {
            c = 0;
            break;
        }
        now = t;
        place = p;
    }
    if (c) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
            
            
            
        