結果
| 問題 | No.274 The Wall |
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-03-24 22:32:15 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 2,000 ms |
| + 142µs | |
| コード長 | 689 bytes |
| 記録 | |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 79,228 KB |
| 実行使用メモリ | 9,908 KB |
| 最終ジャッジ日時 | 2026-10-13 08:49:07 |
| 合計ジャッジ時間 | 1,892 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 100000000
typedef long long ll;
int main() {
int i, n, m;
int a[4001] {};
bool ans;
cin >> n >> m;
rep (i,n) {
int l, r;
cin >> l >> r;
a[l]++; a[r+1]--;
}
rep (i,m) a[i+1] += a[i];
ans = true;
rep (i,m) {
if (a[i] > 2 || a[i] == 2 && a[m-i-1] != 0)
ans = false;
}
if (ans)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}
h_noson