# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1145758 | fatman87878 | Furniture (JOI20_furniture) | C++20 | 1 ms | 1604 KiB |
#include<bits/stdc++.h>
using namespace std;
#define IOS cin.tie(nullptr)->sync_with_stdio(0),cin.exceptions(cin.failbit);
#define lb(x) (x)&-(x)
#define all(x) (x).begin(),(x).end()
#define ll long long
constexpr int maxN=1e3+5;
int n,m,q,cnt[maxN+maxN],c[maxN][maxN],deg[maxN][maxN],ged[maxN][maxN];
queue<pair<int,int>> qup,qdwn;
inline bool chk(int x,int y){
if(x>n||x<1||y>m||y<1||c[x][y])return 0;
return 1;
}
inline void push_up(){
for(int x,y;!qup.empty();){
tie(x,y) = qup.front(),qup.pop();
cnt[x+y]--;
c[x][y] = 1;
if(chk(x-1,y)&&!(--ged[x-1][y]))qup.emplace(x-1,y);
if(chk(x,y-1)&&!(--ged[x][y-1]))qup.emplace(x,y-1);
}
}
inline void push_down(){
for(int x,y;!qdwn.empty();){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |