제출 #650231

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6502312022-10-13 02:50:08truc12a2cvpRaspad (COI17_raspad)C++14
100 / 100
534 ms291324 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> II;
const int N = 1e5 + 5, logN = 20;
const int MOD = 1e9 + 7;
const ll INF = 1e9;
int n, m, vis[N][55], minx, maxx, comp[N][55], nComp;
char a[N][55];
vector<II> vt;
inline bool inside(int x, int y){
return x >= 1 && x <= n && y >= 1 && y <= m;
}
void dfs(int x, int y){
vis[x][y] = true;
vt.push_back(II(x, y));
comp[x][y] = nComp;
minx = min(minx, x);
maxx = max(maxx, x);
for(int nx = x - 1; nx <= x + 1; nx ++){
for(int ny = y - 1; ny <= y + 1; ny ++){
if(inside(nx, ny) && !vis[nx][ny] && a[nx][ny] == '0') dfs(nx, ny);
}
}
}
int main(){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...