# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1045385 | 2024-08-05T22:35:36 Z | beaconmc | Simurgh (IOI17_simurgh) | C++14 | 58 ms | 4144 KB |
#include "simurgh.h" #include <bits/stdc++.h> typedef int ll; #define FOR(i,x,y) for(ll i=x; i<y; i++) #define FORNEG(i,x,y) for(ll i=x; i>y; i--) using namespace std; bool visited[1000]; vector<array<ll,2>> edges[1000]; ll N; vector<ll> ans; void dfs(ll a, ll p){ for (auto&i : edges[a]){ if (i[0] != p && visited[i[0]] == 0){ visited[i[0]] = 1; ans.push_back(i[1]); dfs(i[0], p); } } } vector<int> find_roads(int n, vector<int> u, vector<int> v) { FOR(i,0,u.size()){ edges[u[i]].push_back({v[i],i}); edges[v[i]].push_back({u[i],i}); } set<ll> realans; FOR(i,0,n){ FOR(p,0,1000) visited[p] = 0; ans.clear(); if (i==0) visited[1]=1,dfs(1,i); else visited[0]=1,dfs(0,i); if (ans.size() == n-2){ vector<array<ll,2>> idk; for (auto&j : edges[i]){ ans.push_back(j[1]); ll sus = count_common_roads(ans); idk.push_back({sus, j[1]}); ans.pop_back(); } sort(idk.begin(), idk.end()); for (auto&i : idk) if (i[0] == idk[idk.size()-1][0]) realans.insert(i[1]); } } vector<ll> temp; for (auto&i : realans) temp.push_back(i); return temp; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | correct |
2 | Correct | 0 ms | 348 KB | correct |
3 | Correct | 0 ms | 348 KB | correct |
4 | Correct | 0 ms | 348 KB | correct |
5 | Correct | 0 ms | 348 KB | correct |
6 | Correct | 0 ms | 348 KB | correct |
7 | Correct | 0 ms | 348 KB | correct |
8 | Correct | 0 ms | 348 KB | correct |
9 | Correct | 0 ms | 456 KB | correct |
10 | Correct | 0 ms | 344 KB | correct |
11 | Incorrect | 0 ms | 348 KB | WA in grader: NO |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | correct |
2 | Correct | 0 ms | 348 KB | correct |
3 | Correct | 0 ms | 348 KB | correct |
4 | Correct | 0 ms | 348 KB | correct |
5 | Correct | 0 ms | 348 KB | correct |
6 | Correct | 0 ms | 348 KB | correct |
7 | Correct | 0 ms | 348 KB | correct |
8 | Correct | 0 ms | 348 KB | correct |
9 | Correct | 0 ms | 456 KB | correct |
10 | Correct | 0 ms | 344 KB | correct |
11 | Incorrect | 0 ms | 348 KB | WA in grader: NO |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | correct |
2 | Correct | 0 ms | 348 KB | correct |
3 | Correct | 0 ms | 348 KB | correct |
4 | Correct | 0 ms | 348 KB | correct |
5 | Correct | 0 ms | 348 KB | correct |
6 | Correct | 0 ms | 348 KB | correct |
7 | Correct | 0 ms | 348 KB | correct |
8 | Correct | 0 ms | 348 KB | correct |
9 | Correct | 0 ms | 456 KB | correct |
10 | Correct | 0 ms | 344 KB | correct |
11 | Incorrect | 0 ms | 348 KB | WA in grader: NO |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | correct |
2 | Correct | 0 ms | 348 KB | correct |
3 | Incorrect | 58 ms | 4144 KB | WA in grader: NO |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | correct |
2 | Correct | 0 ms | 348 KB | correct |
3 | Correct | 0 ms | 348 KB | correct |
4 | Correct | 0 ms | 348 KB | correct |
5 | Correct | 0 ms | 348 KB | correct |
6 | Correct | 0 ms | 348 KB | correct |
7 | Correct | 0 ms | 348 KB | correct |
8 | Correct | 0 ms | 348 KB | correct |
9 | Correct | 0 ms | 456 KB | correct |
10 | Correct | 0 ms | 344 KB | correct |
11 | Incorrect | 0 ms | 348 KB | WA in grader: NO |
12 | Halted | 0 ms | 0 KB | - |