# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
426984 | 2021-06-14T11:35:24 Z | Rouge_Hugo | Simurgh (IOI17_simurgh) | C++14 | 634 ms | 1048580 KB |
#include<bits/stdc++.h> #include "simurgh.h" #define fi first #define se second #define pb push_back using namespace std; int n,m;int r=0; const int N=10; int vis[N],yes[N]; vector<pair<int,int>>ev[N]; vector<vector<int>>ans; vector<int>vv; void dfs(int x) { if(vis[x])return; r++;vis[x]=1; for(auto it:ev[x]) { if(!yes[it.se])continue; dfs(it.fi); } } int ch() { memset(yes,0,sizeof yes); memset(vis,0,sizeof vis); for(auto it:vv) { yes[it]=1; }r=0; dfs(0); if(r==n) { return 1; } return 0; } void go(int x) { if(vv.size()>n-1)return; if(x==m) { if(!ch())return; ans.pb(vv); return; } vv.pb(x); go(x+1); vv.pop_back(); go(x+1); } vector<int> find_roads(int N,vector<int> U, vector<int> V) { n=N;m=U.size(); for(int i=0;i<m;i++) { ev[U[i]].pb({V[i],i}); ev[V[i]].pb({U[i],i}); } go(0); for(auto it:ans) { if(count_common_roads(it)==n-1)return it; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 14 ms | 1544 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 14 ms | 1544 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 14 ms | 1544 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | correct |
2 | Runtime error | 634 ms | 1048580 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 14 ms | 1544 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |