# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145426 | 2019-08-19T20:18:45 Z | JovanK26 | Split the Attractions (IOI19_split) | C++14 | 3 ms | 376 KB |
#include "split.h" #include<bits/stdc++.h> using namespace std; vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { vector<int> rez(n); vector<int> v[n]; for(int i=0;i<p.size();i++) { v[p[i]].push_back(q[i]); v[q[i]].push_back(p[i]); } if(a==1) { queue<int> q; bool vis[n]; for(int i=0;i<n;i++) { rez[i]=0; vis[i]=0; } rez[0]=1; int br=0; q.push(0); vis[0]=1; while(!q.empty()) { int node=q.front(); q.pop(); if(node!=0)rez[node]=2; br++; if(br==b)break; for(int i=0;i<v[node].size();i++) { if(!vis[v[node][i]]) { vis[v[node][i]]=1; q.push(v[node][i]); } } } for(int i=0;i<n;i++) { if(rez[i]==0)rez[i]=3; } } return rez; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 256 KB | invalid split: #1=1, #2=0, #3=2 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | invalid split: #1=1, #2=0, #3=2 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | jury found a solution, contestant did not |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | jury found a solution, contestant did not |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 256 KB | invalid split: #1=1, #2=0, #3=2 |
2 | Halted | 0 ms | 0 KB | - |