백준 21938 영상처리 혼내주기
픽셀마다 rgb 값을 읽어서 평균을 낸 뒤 T값을 기준으로 connectivity를 판별해 bfs를 돌리면 된다. 뭔가 귀찮음! #include #define fastio ios::sync_with_stdio(0), cin.tie(0) using namespace std; using ll = long long; using pii = pair; #define all(v) v.begin(), v.end() int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int arr[1005][1005]; bool visited[1005][1005]; int n, m, T; void input() { cin >> n >> m;..
혼내주기
2022. 3. 22. 02:42