Submission #292055

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2920552020-09-06 08:44:46kajebiiiBridges (APIO19_bridges)C++17
Compilation error
0 ms0 KiB
// Comment(Offline, MST, Sqrt)
#include <bits/stdc++.h>
using namespace std;
#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
using ll = long long;
using pi = pair<int, int>;
const int INF = 0x3f3f3f3f;
const ll LINF = 1ll * INF * INF;
using ti = tuple<int, int, int>;
using qi = tuple<int, int, int, int>;
const int MAX_N = 5e4 + 100;
const int MAX_N = 1e5 + 100;
const int ROOT = 250;
struct UF {
int UNF[MAX_N], S[MAX_N], R[MAX_N];
stack<qi> stk;
void init(int n) {
for(int i=0; i<n; i++) UNF[i] = i, S[i] = 1, R[i] = 0;
while(!stk.empty()) stk.pop();
}
int find(int v) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bridges.cpp:20:11: error: redefinition of 'const int MAX_N'
   20 | const int MAX_N = 1e5 + 100;
      |           ^~~~~
bridges.cpp:19:11: note: 'const int MAX_N' previously defined here
   19 | const int MAX_N = 5e4 + 100;
      |           ^~~~~
bridges.cpp:62:9: error: 'MAX_Q' was not declared in this scope; did you mean 'MAX_N'?
   62 | int Ans[MAX_Q];
      |         ^~~~~
      |         MAX_N
bridges.cpp: In function 'int main()':
bridges.cpp:132:4: error: 'Ans' was not declared in this scope
  132 |    Ans[q] = uf.S[uf.find(st)];
      |    ^~~
bridges.cpp:145:29: error: 'Ans' was not declared in this scope
  145 |   if(t == 2) printf("%d\n", Ans[i]);
      |                             ^~~
bridges.cpp:67:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   67 |   int x, y, c; scanf("%d%d%d", &x, &y, &c);
      |                ~~~~~^~~~~~~~~~~~~~~~~~~~~~
bridges.cpp:73:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   73 |   int t, x, y; scanf("%d%d%d", &t, &x, &y);
      |                ~~~~~^~~~~~~~~~~~~~~~~~~~~~