Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A {
- void print_state();
- int *m_var;
- int m_Nvar;
- std::vector<std::vector<std::int> > m_doms;
- std::vector<std::vector<std::int> > m_groups;
- std::vector<std::string> > m_words;
- int *m_cst1;
- int *m_cst2;
- int m_Ncst;
- CwordSolver::CwordSolver(std::string words[], int num,
- int c1[], int m, int c2[], int n) {
- // we are only interested, the words of length smaller than m_max_len
- // put m_max_len number of empty vectors (groups) in the group vector
- for (int i = 0; i < m_max_len; i++)
- {
- m_groups.push_back(std::vector<int>());
- }
- // go through every words and copy words of interest to m_words
- // push the index of the word to the group it belongs to (by its length)
- for (int i = 0, k = 0; i < num; i++, k++)
- {
- int len = words[i].length();
- if (len > m_max_len)
- continue;
- m_words.push_back(words[i]);
- m_groups[len].push_back(k);
- }
- // you can ignore this part: link the group to another structure
- for (int i = 0; i < m_Nvar; i++)
- {
- m_doms.push_back(m_groups[m_cst1[i]]);
- }
- ...
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement