結果
問題 | No.274 The Wall |
ユーザー |
![]() |
提出日時 | 2016-03-24 22:32:15 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 689 bytes |
コンパイル時間 | 449 ms |
コンパイル使用メモリ | 59,672 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 02:07:42 |
合計ジャッジ時間 | 1,122 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#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 100000000typedef 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;elsecout << "NO" << endl;return 0;}