#include <set>
#include <cstdlib>
#include <ctime>
#include <iostream>
usingnamespace std;
int main()
{
set<int> alreadyUsedNumbers;
constint n = 4;
constint m = 5;
int arr[n][m]; // THIS IS ILLEGAL C++ IF n AND m ARE NOT CONSTANTS. AS IN YOUR CODE. YOUR CODE IS BAD.
srand(time(NULL));
for (int i = 0; i<n*m; ++i)
{
int number = rand();
while (alreadyUsedNumbers.find(number) != alreadyUsedNumbers.end())
{
number = rand();
}
arr[0][i] = number;
alreadyUsedNumbers.insert(number);
}
}