# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
217821 | 2020-03-30T22:02:48 Z | milagrosvilla1803 | Birmingham (COCI20_birmingham) | C++11 | 131 ms | 26848 KB |
#include <bits/stdc++.h> using namespace std; int n,m,q,k; vector<int>ady[200005]; vector<int>d[100005]; int enterarse[100005]; int distancia[100005]; int aux; int x,y; queue<int> fila; int color[100005]; void bfs(){ while(!fila.empty()){ int nodoAct=fila.front(); fila.pop(); for(int i=0;i<ady[nodoAct].size();i++){ int hijo=ady[nodoAct][i]; if(color[hijo]==0){ color[hijo]=1; distancia[hijo]=distancia[nodoAct]+1; fila.push(hijo); } } color[nodoAct]=2; } } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin>>n>>m>>q>>k; memset(enterarse,-1,n); for(int i=0;i<q;i++){ cin>>aux; enterarse[aux]=0; fila.push(aux); color[aux]=1; distancia[aux]=0; } for(int i=0;i<m;i++){ cin>>x>>y; ady[x].push_back(y); ady[y].push_back(x); } bfs(); for(int i=0;i<n;i++) d[distancia[i]].push_back(i); int adj=q,a=1,dia=1; while(adj<n){ while(a<=k*dia){ for(int i=0;i<d[a].size();i++){ adj++; enterarse[d[a][i]]=dia; } a++; } dia++; } for(int i=1;i<=n;i++) cout<<enterarse[i]<<" "; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 14720 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 14720 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 14720 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 14824 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 14720 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 14848 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 14720 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 98 ms | 26616 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 131 ms | 26848 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 115 ms | 26716 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 94 ms | 26104 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 107 ms | 26228 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 107 ms | 26344 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 94 ms | 26464 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |