# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
411573 | 2021-05-25T14:11:44 Z | ioi | Split the Attractions (IOI19_split) | C++14 | 89 ms | 12760 KB |
#include "split.h" #include<bits/stdc++.h> using namespace std; int N ; vector<int> adj[100005]; int vis[100005]; int A , B , C ; vector<int> res ; void dfs(int node){ vis[node] ++ ; if(A)A -- , res[node] = 1 ; else if(B)B -- , res[node] = 2 ; else C -- , res[node] = 3 ; for(auto f : adj[node]){ if(!vis[f])dfs(f); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { res.resize(n); A = a , B = b , C = c ; for(int i = 0 ; i < p.size() ; i ++) adj[p[i]].push_back(q[i]) , adj[q[i]].push_back(p[i]); dfs(0); return res; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | ok, correct split |
2 | Correct | 2 ms | 2636 KB | ok, correct split |
3 | Correct | 2 ms | 2636 KB | ok, correct split |
4 | Correct | 2 ms | 2636 KB | ok, correct split |
5 | Correct | 2 ms | 2560 KB | ok, correct split |
6 | Correct | 3 ms | 2636 KB | ok, correct split |
7 | Correct | 67 ms | 12632 KB | ok, correct split |
8 | Correct | 87 ms | 11680 KB | ok, correct split |
9 | Correct | 64 ms | 11360 KB | ok, correct split |
10 | Correct | 67 ms | 12752 KB | ok, correct split |
11 | Correct | 70 ms | 12760 KB | ok, correct split |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | ok, correct split |
2 | Correct | 2 ms | 2636 KB | ok, correct split |
3 | Correct | 2 ms | 2636 KB | ok, correct split |
4 | Correct | 89 ms | 10988 KB | ok, correct split |
5 | Incorrect | 60 ms | 8516 KB | 2 components are not connected |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | ok, correct split |
2 | Incorrect | 70 ms | 9776 KB | 2 components are not connected |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2636 KB | 2 components are not connected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | ok, correct split |
2 | Correct | 2 ms | 2636 KB | ok, correct split |
3 | Correct | 2 ms | 2636 KB | ok, correct split |
4 | Correct | 2 ms | 2636 KB | ok, correct split |
5 | Correct | 2 ms | 2560 KB | ok, correct split |
6 | Correct | 3 ms | 2636 KB | ok, correct split |
7 | Correct | 67 ms | 12632 KB | ok, correct split |
8 | Correct | 87 ms | 11680 KB | ok, correct split |
9 | Correct | 64 ms | 11360 KB | ok, correct split |
10 | Correct | 67 ms | 12752 KB | ok, correct split |
11 | Correct | 70 ms | 12760 KB | ok, correct split |
12 | Correct | 2 ms | 2636 KB | ok, correct split |
13 | Correct | 2 ms | 2636 KB | ok, correct split |
14 | Correct | 2 ms | 2636 KB | ok, correct split |
15 | Correct | 89 ms | 10988 KB | ok, correct split |
16 | Incorrect | 60 ms | 8516 KB | 2 components are not connected |
17 | Halted | 0 ms | 0 KB | - |