Submission #804131

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8041312023-08-03 07:17:45finn__Fountain Parks (IOI21_parks)C++17
45 / 100
306 ms48424 KiB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
template <size_t N>
struct dsu
{
int64_t p[N];
dsu() { fill(p, p + N, -1); }
int64_t repr(int64_t u) { return p[u] < 0 ? u : p[u] = repr(p[u]); }
bool merge(int64_t i, int64_t j)
{
i = repr(i);
j = repr(j);
if (i == j)
return 0;
if (p[i] > p[j])
swap(i, j);
p[i] += p[j];
p[j] = i;
return 1;
}
bool same_set(int64_t i, int64_t j) { return repr(i) == repr(j); }
int64_t set_size(int64_t i) { return -p[repr(i)]; }
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:133:98: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
  133 |                     if (cand.second == y && ((min(x, cand.first) & 3) == 1) ^ ((y & 3) == 3) ^ x > cand.first)
      |                                                                                                ~~^~~~~~~~~~~~
parks.cpp:138:98: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
  138 |                     if (cand.first == x && ((min(y, cand.second) & 3) == 1) ^ ((x & 3) == 3) ^ y > cand.second)
      |                                                                                                ~~^~~~~~~~~~~~~
parks.cpp:188:23: warning: comparison of integer expressions of different signedness: 'int64_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
  188 |     if (d.set_size(0) != n)
      |         ~~~~~~~~~~~~~~^~~~
#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...