# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
684852 | US3RN4M3 | T-Covering (eJOI19_covering) | C++17 | 314 ms | 47804 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int mx = 1005;
int val[mx*mx];
int sid[mx*mx];
bool g_vis[mx*mx];
int n, m;
int dx1[4] = {1, 1, 1, 0};
int dy1[4] = {1, 0, -1, 1};
int dx2[2] = {2, 0};
int dy2[2] = {0, 2};
int dx3[4] = {1, -1, 0, 0};
int dy3[4] = {0, 0, 1, -1};
int dx4[5] = {0, 1, -1, 0, 0};
int dy4[5] = {0, 0, 0, -1, 1};
vector<pair<int, int>> heavy_edges;
vector<pair<int, int>> light_edges;
int g_idx[mx*mx];
vector<int> g_vec[mx*mx];
int g_best[mx*mx];
int g_bad[mx*mx];
void add_light(int a, int b) {
g_bad[g_idx[b]]++;
if(g_idx[a] == g_idx[b]) return;
if(g_vec[g_idx[a]].size() > g_vec[g_idx[b]].size()) swap(a, b);
g_best[g_idx[b]] = min(g_best[g_idx[b]], g_best[g_idx[a]]);
g_bad[g_idx[b]] += g_bad[g_idx[a]];
vector<int> & a_vec = g_vec[g_idx[a]];
for(int i : a_vec) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |