# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1102026 | razivo | Viruses (BOI20_viruses) | C++14 | 1 ms | 336 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <climits>
using namespace std;
int main() {
int g,n,m; cin>>g>>n>>m;
vector<vector<vector<int>>> mut(g+1);
for (int i = 0; i < n; ++i) {
int x,y; cin>>x>>y;
int t = mut[x].size();
mut[x].push_back({});
for (int j = 0; j < y; ++j) {
int u; cin>>u;
mut[x][t].push_back(u);
}
}
vector<vector<int>> anti(m);
for (int i = 0; i < m; ++i) {
int l; cin>>l;
for (int j = 0; j < l; ++j) {
int u; cin>>u;
anti[i].push_back(u);
}
}
if(m==0) {
vector<int> len(g+1,INT_MAX);
len[0]=1;
len[1]=1;
for (int i = 2; i < g+1; ++i) {
for (int j = 0; j < mut[i].size(); ++j) {
int res = 0;
for (int k = 0; k < mut[i][j].size(); ++k) {
res+=len[mut[i][j][k]];
}
len[i]=min(len[i],res);
}
}
for (int i = 2; i < g+1; ++i) {
cout<<"NO " << len[i];
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |