結果

問題 No.686 Uncertain LIS
ユーザー shadowYYHshadowYYH
提出日時 2023-12-24 20:52:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 788 bytes
コンパイル時間 1,677 ms
コンパイル使用メモリ 167,536 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2023-12-24 20:52:31
合計ジャッジ時間 20,771 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 4 ms
6,548 KB
testcase_04 AC 3 ms
6,548 KB
testcase_05 AC 4 ms
6,548 KB
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 AC 2 ms
6,548 KB
testcase_09 AC 1,997 ms
6,548 KB
testcase_10 AC 1,921 ms
6,548 KB
testcase_11 AC 1,323 ms
6,548 KB
testcase_12 AC 66 ms
6,548 KB
testcase_13 AC 687 ms
6,548 KB
testcase_14 AC 16 ms
6,548 KB
testcase_15 AC 11 ms
6,548 KB
testcase_16 AC 26 ms
6,548 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 AC 32 ms
6,548 KB
testcase_21 AC 32 ms
6,548 KB
testcase_22 AC 6 ms
6,548 KB
testcase_23 AC 5 ms
6,548 KB
testcase_24 AC 38 ms
6,548 KB
testcase_25 AC 39 ms
6,548 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

char buf[(1<<21)+5],*p1,*p2;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)

inline int read() {
	int x = 0, f = 0; char ch = getchar();
	while (!isdigit(ch)) f |= (ch == '-'), ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
	return f ? -x : x;
}

const int N = 5e5 + 500; int f[N];
int ma = 0;
signed main() {
	// freopen("lis.in", "r", stdin);
	// freopen("1.out", "w", stdout);
	int T = read(); while (T--) {
		int l = read(), r = read();
        while (ma < r) ++ma, f[ma] = f[ma - 1];
        for (int i = r; i >= l; --i) f[i] = f[i - 1] + 1;
        for (int i = r + 1; i <= ma; ++i) {
            if (f[i] >= f[r]) break; f[i] = f[r]; }
	} cout << f[ma];
	return 0;
}
0