제출 #757625

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7576252023-06-13 13:03:11HanksburgerFurniture (JOI20_furniture)C++17
100 / 100
372 ms15932 KiB
#include <bits/stdc++.h>
using namespace std;
int a[1005][1005], cnt[2005], visited[1005][1005], n, m, o;
queue<pair<int, int> > q;
int f(int x, int y)
{
return (1<=x && x<=n && 1<=y && y<=m);
}
void g()
{
while (!q.empty())
{
int ux=q.front().first, uy=q.front().second;
q.pop();
if (a[ux-1][uy+1])
{
if (f(ux-1, uy) && !a[ux-1][uy])
{
a[ux-1][uy]=1;
cnt[ux+uy-1]--;
q.push({ux-1, uy});
}
if (f(ux, uy+1) && !a[ux][uy+1])
{
a[ux][uy+1]=1;
cnt[ux+uy+1]--;
q.push({ux, uy+1});
}
}
if (a[ux+1][uy-1])
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...