Submission #1070334

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10703342024-08-22 13:20:56vjudge1Bridges (APIO19_bridges)C++17
100 / 100
1703 ms12424 KiB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int u[100005], v[100005], x[100005], y[100005], dd[100005], res[100005];
int p[50005], s[50005], ll = 1000;
vector<pair<int, int>> vv;
struct QUERY {
int w, x, y, num;
} b[100005];
int Find(int x) {
if (x == p[x]) return x;
return Find(p[x]);
}
void Merge(int x, int y, int flag) {
x = Find(x);
y = Find(y);
if (x == y) return;
if (s[x] < s[y]) swap(x, y);
s[x] += s[y];
p[y] = x;
if (flag == 1) vv.push_back({x, y});
}
void roll() {
int x = vv.back().first, y = vv.back().second;
vv.pop_back();
p[y] = y;
s[x] -= s[y];
}
bool cmp(QUERY aa, QUERY bb) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bridges.cpp: In function 'int main()':
bridges.cpp:77:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<QUERY>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   77 |             while (j < vb.size() && vb[j].y >= w.y) {
      |                    ~~^~~~~~~~~~~
#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...