MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / check

Function check

code/other/lis.test.cpp:16–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void check(int n) {
17 vi arr(n);
18 rep(i,0,n) arr[i] = rng() % 100;
19
20 mem.clear();
21 int mx = 0;
22 rep(i,0,n) {
23 mx = max(mx, lis_dp(arr, i));
24 }
25
26 vi res = lis(arr);
27 assert_equal(mx, (int)res.size());
28 rep(i,1,res.size()) {
29 assert_true(arr[res[i-1]] < arr[res[i]]);
30 }
31}
32
33void test() {
34 check(0);

Callers 1

testFunction · 0.70

Calls 6

lis_dpFunction · 0.85
lisFunction · 0.85
assert_trueFunction · 0.85
assert_equalFunction · 0.50
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected