# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1102026 | 2024-10-17T10:23:55 Z | razivo | Viruses (BOI20_viruses) | C++14 | 1 ms | 336 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |