Submission #624585

#TimeUsernameProblemLanguageResultExecution timeMemory
624585moyindavid낙하산 고리들 (IOI12_rings)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> int N; vector<int> v[2000]; int sz[2000]{0}; void Init(int N_) { N = N_; } void Link(int A, int B) { v[A].push_back(B); v[B].push_back(A); //sz[A]++;sz[B]++; } int CountCritical() { int ans=0; for(int i=0;i<N;i++){ /*cnt=0; if(sz[i]>2)cnt++; for(auto u: v[i]){ if(sz[u]==3)cnt++; } if(cnt==rem)ans++;*/ for(int j=0;j<N;j++){ if(j==i)continue; queue<int> q;q.push(j); bool vis[N]{0}, flag=0; while(!q.empty()){ int a=q.front();q.pop(); int cnt=0; for(auto u: v[a]){ if(u==i)continue; if(vis[u]==1)cnt++; if(cnt>1 || v[a].size()>3){ flag=true; break; } } if(flag)break; } if(flag){ ans--; break; } } ans++; } return ans; }

Compilation message (stderr)

rings.cpp:3:1: error: 'vector' does not name a type
    3 | vector<int> v[2000];
      | ^~~~~~
rings.cpp: In function 'void Link(int, int)':
rings.cpp:13:5: error: 'v' was not declared in this scope
   13 |     v[A].push_back(B);
      |     ^
rings.cpp: In function 'int CountCritical()':
rings.cpp:30:13: error: 'queue' was not declared in this scope; did you mean 'std::queue'?
   30 |             queue<int> q;q.push(j);
      |             ^~~~~
      |             std::queue
In file included from /usr/include/c++/10/queue:64,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from rings.cpp:1:
/usr/include/c++/10/bits/stl_queue.h:96:11: note: 'std::queue' declared here
   96 |     class queue
      |           ^~~~~
rings.cpp:30:19: error: expected primary-expression before 'int'
   30 |             queue<int> q;q.push(j);
      |                   ^~~
rings.cpp:30:26: error: 'q' was not declared in this scope
   30 |             queue<int> q;q.push(j);
      |                          ^
rings.cpp:36:29: error: 'v' was not declared in this scope
   36 |                 for(auto u: v[a]){
      |                             ^