結果
| 問題 |
No.686 Uncertain LIS
|
| コンテスト | |
| ユーザー |
square1001
|
| 提出日時 | 2018-01-14 19:52:02 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 468 ms |
| コンパイル使用メモリ | 65,908 KB |
| 実行使用メモリ | 17,224 KB |
| 最終ジャッジ日時 | 2024-12-24 03:01:53 |
| 合計ジャッジ時間 | 76,268 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 8 TLE * 24 |
ソースコード
#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;
}
square1001