結果

問題 No.1205 Eye Drops
ユーザー msm1993
提出日時 2020-10-08 10:12:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 1,731 ms
コンパイル使用メモリ 169,872 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 05:49:12
合計ジャッジ時間 3,001 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N, M;
	cin >> N >> M;
	vector<long long> T( M );
	vector<int> P( M );
	for( int i = 0; i < M; i++ ) {
		cin >> T[i] >> P[i];
	}

	long long ct = 0;
	long long cp = 0;
	string ans = "Yes";
	for( int i = 0; i < M; i++ ) {
		if( abs(P[i] - cp) > T[i] - ct ) {
			ans = "No";
			break;
		}
		ct = T[i];
		cp = P[i];
	}

	cout << ans << endl;
}
0