Submission #1102027

# Submission time Handle Problem Language Result Execution time Memory
1102027 2024-10-17T10:25:26 Z razivo Viruses (BOI20_viruses) C++14
0 / 100
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);
    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

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 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 -