Submission #609555

#TimeUsernameProblemLanguageResultExecution timeMemory
609555OzyKeys (IOI21_keys)C++17
Compilation error
0 ms0 KiB
rep(i,0,n-1) uf[i] = {i,1}; rep(i,0,m-1) une(u[i],v[i]); peor = 1<<30; vector<int> res; res.resize(n,0); rep(i,0,n-1) { if (r[i] != 0) res[i] = 1; else { a = sube(i); res[i] = uf[a].num; } peor = min(res[i],peor); } rep(i,0,n-1) if (res[i] == peor) res[i] = 1; else res[i] = 0; return res; }

Compilation message (stderr)

keys.cpp:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 |  rep(i,0,n-1) uf[i] = {i,1};
      |     ^
keys.cpp:4:5: error: expected constructor, destructor, or type conversion before '(' token
    4 |  rep(i,0,m-1) une(u[i],v[i]);
      |     ^
keys.cpp:6:2: error: 'peor' does not name a type
    6 |  peor = 1<<30;
      |  ^~~~
keys.cpp:7:2: error: 'vector' does not name a type
    7 |  vector<int> res;
      |  ^~~~~~
keys.cpp:8:2: error: 'res' does not name a type
    8 |  res.resize(n,0);
      |  ^~~
keys.cpp:9:5: error: expected constructor, destructor, or type conversion before '(' token
    9 |  rep(i,0,n-1) {
      |     ^
keys.cpp:19:5: error: expected constructor, destructor, or type conversion before '(' token
   19 |  rep(i,0,n-1) if (res[i] == peor) res[i] = 1;
      |     ^
keys.cpp:20:2: error: expected unqualified-id before 'else'
   20 |  else res[i] = 0;
      |  ^~~~
keys.cpp:22:2: error: expected unqualified-id before 'return'
   22 |  return res;
      |  ^~~~~~
keys.cpp:23:1: error: expected declaration before '}' token
   23 | }
      | ^