#include #include bool isEven(int x){ return (x%2)==0; } // pozice = index ve stringu std::vector getHashPos(){ std::string line; std::getline(std::cin, line ); size_t x = std::stoi(line); //how many lines does the matrix have std::vector hashpos(x); for(size_t i = 0; i hashpos){ size_t cur_idx = 0; int n = 1; while(cur_idx + 1 < hashpos.size()) { size_t pos_cur = hashpos[cur_idx]; size_t pos_next = hashpos[cur_idx + 1]; if (pos_next < pos_cur) { n = (2 * n) + 1; } else { n *= 2; } cur_idx++; //std::cout << n << std::endl; } return n; } void printOutput(int nLines, int lineW, int CNum, int startPos){ int curNum = CNum; // součet std::cout << nLines; std::cout << std::endl; std::vector matrix(nLines); int cur = startPos; for(int i = nLines-1; i >= 0; i--){ matrix[i]=(char*)malloc(lineW * sizeof(char)); std::cerr << "Line: " << i << std::endl; for(int j = 0; j hashpos1, hashpos2; hashpos1 = getHashPos(); hashpos2 = getHashPos(); // for(size_t i = 0; i