Submission #684852

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6848522023-01-22 17:00:45US3RN4M3T-Covering (eJOI19_covering)C++17
100 / 100
314 ms47804 KiB
#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) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

covering.cpp:39:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   39 | main() {
      | ^~~~
covering.cpp: In function 'int main()':
covering.cpp:94:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   94 |   if(g_bad[id] > g_vec[id].size()) {
      |      ~~~~~~~~~~^~~~~~~~~~~~~~~~~~
covering.cpp:98:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   98 |    for(int j = 0; j < g_vec[id].size(); j++) {
      |                   ~~^~~~~~~~~~~~~~~~~~
covering.cpp:105:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  105 |   if(g_bad[id] == g_vec[id].size()) continue;
      |      ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...