Submission #470971

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4709712021-09-06 13:30:58iulia13Furniture (JOI20_furniture)C++14
100 / 100
2426 ms12980 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, m;
bool SePoate[N][N];
int diag[N + N];
int b = 1;
struct ura{
int x, y;
};
int verif(int x, int y)
{
if (x < 1 || y < 1 || n < x || m < y)
return 1;
return 0;
}
void upd(int x, int y)
{
if (verif(x, y) || SePoate[x][y] == false)
return;
SePoate[x][y] = false;
diag[x + y]--;
if (verif(x - 1, y + 1) || SePoate[x - 1][y + 1] == false)
{
upd(x, y + 1);
upd(x - 1, y);
}
if (verif(x + 1, y - 1) || SePoate[x + 1][y - 1] == false)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...