LongestIncreasingSubsequence2_test.cpp 398 B

1234567891011121314151617
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef vector<int> VI;
  4. typedef pair<int, int> PII;
  5. typedef vector<PII> VPII;
  6. #include "LongestIncreasingSubsequence.cpp"
  7. int main() {
  8. VI v = {1, 2, 3, 4, 7, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  9. VI r = LongestIncreasingSubsequence(v);
  10. for(int i = 0; i < r.size()-1; i++)
  11. assert(r[i] <= r[i+1]);
  12. assert(r.size() == 12);
  13. return 0;
  14. }