Submission #1102027

#TimeUsernameProblemLanguageResultExecution timeMemory
1102027razivoViruses (BOI20_viruses)C++14
0 / 100
1 ms336 KiB
#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); 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,INT_MAX); len[0]=1; len[1]=1; for (int i = 2; i < g; ++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; ++i) { cout<<"NO " << len[i]<<endl; } } }

Compilation message (stderr)

Viruses.cpp: In function 'int main()':
Viruses.cpp:30:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |             for (int j = 0; j < mut[i].size(); ++j) {
      |                             ~~^~~~~~~~~~~~~~~
Viruses.cpp:32:35: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |                 for (int k = 0; k < mut[i][j].size(); ++k) {
      |                                 ~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...