結果
| 問題 | No.686 Uncertain LIS |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-01-14 19:52:02 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 465 bytes |
| 記録 | |
| コンパイル時間 | 354 ms |
| コンパイル使用メモリ | 79,592 KB |
| 実行使用メモリ | 16,192 KB |
| 最終ジャッジ日時 | 2026-05-29 22:54:04 |
| 合計ジャッジ時間 | 4,457 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 6 TLE * 1 -- * 26 |
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
int n, l, r, a[100009];
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> l >> r;
for (int j = r; j <= 100000; j++) {
if (a[j] == 1) a[j] = 0;
}
for (int j = l; j < r; j++) {
if (a[j] == 1) a[j + 1] = 1, a[j] = 0;
}
a[l] = 1;
}
int ret = 0;
for (int i = 0; i <= 100000; i++) ret += a[i];
cout << ret << endl;
return 0;
}