結果
問題 | No.1205 Eye Drops |
ユーザー | hgoto |
提出日時 | 2020-11-27 11:56:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 415 bytes |
コンパイル時間 | 2,082 ms |
コンパイル使用メモリ | 190,920 KB |
最終ジャッジ日時 | 2025-01-16 06:02:21 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 37 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(0); cin.tie(0); ll n, m; cin >> n >> m; ll pos = 0, time = 0; while (m--) { ll t, p; cin >> t >> p; ll dx = abs(p - pos); ll dt = t - time; if (dx <= dt) { pos = p; time = t; } else { cout << "No" << '\n'; return 0; } } cout << "Yes" << '\n'; }