結果
問題 | No.686 Uncertain LIS |
ユーザー |
![]() |
提出日時 | 2018-01-14 19:58:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 487 bytes |
コンパイル時間 | 685 ms |
コンパイル使用メモリ | 66,048 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-24 03:02:48 |
合計ジャッジ時間 | 51,547 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 14 TLE * 16 |
ソースコード
#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;break;}}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;}