I'm solving some simple problem, but I have a problem, I can only input variables N, M and P, I can't input variables tempX and tempY which are in loop, here is the code:
#include <iostream>
#include <vector>
#include <minmax.h>
using namespace std;
typedef unsigned long long ull;
int main() {
ull n, m, p;
cin >> n >> m >> p;
vector<vector<unsigned short> > field;
field.resize(n);
for (ull i = 0; i < m; i++)
for (ull j = 0; j < m; j++)
field[i].push_back(1);
for (ull i = 0; i < p; i++) {
ull tempX, tempY;
cin >> tempX >> tempY;
field[tempX][tempY] = 0;
}
for (ull i = 1; i < n; i++)
for (ull j = 1; j < m; j++)
if (field[i - 1][j - 1] != 0 && field[i][j] != 0)
field[i][j] = min(field[i - 1][j], field[i][j - 1]) + 1;
ull maxLength = 0;
for (ull i = 0; i < n; i++)
for (ull j = 0; j < m; j++)
maxLength = max(maxLength, field[i][j]);
cout << maxLength << endl;
return 0;
}
Btw. I had problems with printing simple text with cout, there was no problem in code but something is preventing printing simple text like "Hello world", is that connected in any way with this problem?