LongestIncreasingSubsequence_test.cpp 418 B

123456789101112131415161718
  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. #define STRICTLY_INCREASNG
  7. #include "LongestIncreasingSubsequence.cpp"
  8. int main() {
  9. VI v = {3, 4, 7, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  10. VI r = LongestIncreasingSubsequence(v);
  11. for(int i = 0; i < r.size()-1; i++)
  12. assert(r[i] < r[i+1]);
  13. assert(r.size() == 10);
  14. return 0;
  15. }