# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
613720 | 2022-07-30T09:45:29 Z | Mr_Husanboy | Simurgh (IOI17_simurgh) | C++14 | 1 ms | 340 KB |
#include "simurgh.h" #include<bits/stdc++.h> using namespace std; #define all(a) (a).begin(), (a).end() #define vi vector<int> #define ff first #define ss second vector<pair<int,int>> g[500]; vector<int> find_roads(int n, vector<int> u, vector<int> v) { vector<int> p; for(int i=0; i<u.size(); i++){ g[u[i]].push_back({v[i],i}); g[v[i]].emplace_back(u[i],i); } for(int i=0; i<n; i++) p.push_back(i); do{ bool ok = 1; vector<int> tem; for(int i=1; i<n && ok; i++){ bool found = 0; for(auto u : g[p[i]]){ if(u.ff == p[i-1]){ found = 1; tem.push_back(u.ss); } ok &= found; if(found) break; } } if(tem.size() == 3){ if(count_common_roads(tem) == n-1) return tem; } }while(next_permutation(all(p))); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |