repl.it
C++11

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <algorithm> // min
#include <cstring> // memset
#include <iostream>

class KLIS {
private:
    // number of elements <= 500, 1 <= value of element <= 100,000
    int numEs;

    // kth <= int max = 2,147,483,647
    unsigned kth;

    int elements[501];
    int lisCache[501];
    
    int lis(int i)
    {
        
    }

    int lis()
    {
        return lis(0);
    }

public:
    KLIS()
    {
        elements[0] = 0;
    };

    void run()
    {
        using namespace std;
        cout << lis() << endl;
        
        // todo

        cout << endl;
    }

    inline void init()
    {
        memset(lisCache, 0, 501);
        std::cin >> numEs >> kth;
        for (int i = 1; i <= numEs; i++)
            std::cin >> elements[i];
    }
};

int main()
{
    int cases;
    int lis;
    std::cin >> cases;
    KLIS klis;
    while (cases--) {
        klis.init();
        klis.run();
    }
    return 0;
}
Fetching token
?