Submission #834599

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8345992023-08-22 15:47:52kingfran1907Making Friends on Joitter is Fun (JOI20_joitter2)C++14
0 / 100
9 ms19028 KiB
#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long llint;
const int maxn = 2e5+10;
int n, m;
int cale[maxn], siz[maxn];
llint sol = 0;
set< pair<int, int> > graph[maxn], graph2[maxn];
int fin(int x) {
if (x == cale[x]) return x;
return cale[x] = fin(cale[x]);
}
int get_size(int x) {
return graph[x].size() + graph2[x].size();
}
void remove(int x, set< pair<int, int> > &s, bool flag = false) {
auto iter = s.lower_bound({x, -1});
while (iter != s.end() && iter->X == x) {
sol -= siz[x] * flag;
iter = s.erase(iter);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

joitter2.cpp: In function 'void merge(int, int)':
joitter2.cpp:63:7: warning: unused variable 'las' [-Wunused-variable]
   63 |   int las = iter.Y;
      |       ^~~
joitter2.cpp:76:7: warning: unused variable 'las' [-Wunused-variable]
   76 |   int las = iter.Y;
      |       ^~~
joitter2.cpp: In function 'int main()':
joitter2.cpp:92:15: warning: unused variable 'cb' [-Wunused-variable]
   92 |   int ca = a, cb = b;
      |               ^~
joitter2.cpp:85:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   85 |  scanf("%d%d", &n, &m);
      |  ~~~~~^~~~~~~~~~~~~~~~
joitter2.cpp:90:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   90 |   scanf("%d%d", &a, &b);
      |   ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...