# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1101568 | 2024-10-16T10:43:46 Z | MMihalev | Simurgh (IOI17_simurgh) | C++14 | 1 ms | 508 KB |
#include<iostream> #include<algorithm> #include<set> #include<queue> #include "simurgh.h" using namespace std; const int MAX_N=5e2+3; const int MAX_M=125000; int n,m; int q; vector<int>edges; vector<int>adj; vector<vector<int> >edgesadj; vector<int>dfs; vector<vector<int> >edgesdfs; vector<pair<int,int> >g[MAX_N]; bool used[MAX_N]; bool marked[MAX_N]; bool stat[MAX_M]; int adje[MAX_N]; bool ok[MAX_N][MAX_N]; vector<int> find_roads(int N, vector<int> u, vector<int> v) { n=N; m=u.size(); vector<int>ans; vector<pair<int,int>>so; for(int i=0;i<m;i++) { g[u[i]].push_back({v[i],i}); g[v[i]].push_back({u[i],i}); ok[u[i]][v[i]]=i; ok[v[i]][u[i]]=i; } for(int i=0;i<n;i++) { so.push_back({g[i].size(),i}); } sort(so.rbegin(),so.rend()); int cnt=0; for(auto [sz,u]:so) { cnt++; marked[u]=1; for(auto [v,edge]:g[u])used[v]=1; bool bad=0; for(int i=0;i<n;i++) { if(marked[i])continue; if(used[i])continue; bad=1; break; } if(bad==0) { if(cnt>100)while(1); break; } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 508 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |