Submission #384162

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3841622021-03-31 15:35:18qwerty234Making Friends on Joitter is Fun (JOI20_joitter2)C++14
100 / 100
2251 ms171372 KiB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
const int MAXN = 4e5 + 10;
set <int> in[MAXN], out_set[MAXN], in_set[MAXN];
set <pair<int, int>> out_edge[MAXN], in_edge[MAXN];
set <int>::iterator it;
set <pair<int, int>>::iterator itt;
int n, m, ptr[MAXN], p[MAXN], sz[MAXN];
ll ans;
void make_set() {
for (int i = 1; i <= n; i++) {
p[i] = i; sz[i] = 1;
in[i].clear(); out_set[i].clear(); in_set[i].clear();
out_edge[i].clear(); in_edge[i].clear();
ptr[i] = i;
}
ans = 0;
}
int getp(int u) {
if (p[u] == u)
return u;
return p[u] = getp(p[u]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

joitter2.cpp: In function 'void un(int, int)':
joitter2.cpp:43:9: warning: unused variable 'fr' [-Wunused-variable]
   43 |     int fr = tmp.fi, to = tmp.se;
      |         ^~
joitter2.cpp:54:22: warning: unused variable 'to' [-Wunused-variable]
   54 |     int fr = tmp.fi, to = tmp.se;
      |                      ^~
joitter2.cpp: At global scope:
joitter2.cpp:127:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  127 | main() {
      |      ^
joitter2.cpp: In function 'int main()':
joitter2.cpp:129:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  129 |   scanf("%d %d", &n, &m);
      |   ~~~~~^~~~~~~~~~~~~~~~~
joitter2.cpp:133:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  133 |     scanf("%d %d", &u, &v);
      |     ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...