Submission #472559

# Submission time Handle Problem Language Result Execution time Memory
472559 2021-09-13T18:02:21 Z ZaZo_ Political Development (BOI17_politicaldevelopment) C++14
16 / 100
162 ms 10004 KB
#include <bits/stdc++.h>
#define ZAZO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
using namespace std;
vector<int>edges[50001];
int vis[50001]={0};
int mx=1,n,k;
int32_t main() {
  ZAZO
  cin >> n >> k ;
  for(int i = 0 ; i < n ; i ++)
  {
    int d;
    cin>>d;
    for(int j = 0 ; j < d ; j ++)
    {
      mx=2;
      int x; cin>>x;
      edges[i].push_back(x);
      edges[x].push_back(i);
    }
  }
  for(int i = 0 ; i < n ; i ++)
  {
    for(int j = 0 ; j < edges[i].size() ; j ++)
    {
      for(int p = j+1 ; p < edges[i].size(); p++)
      {
        int p1 = edges[i][j] , p2 = edges[i][p];
        auto it = find(edges[p1].begin(),edges[p1].end(),p2);
        if(it!=edges[p1].end())
        {
          cout<<"3";
          return 0;
        }
      }
    }
  }
  cout<<mx<<endl;
}

Compilation message

politicaldevelopment.cpp: In function 'int32_t main()':
politicaldevelopment.cpp:25:23: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int j = 0 ; j < edges[i].size() ; j ++)
      |                     ~~^~~~~~~~~~~~~~~~~
politicaldevelopment.cpp:27:27: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |       for(int p = j+1 ; p < edges[i].size(); p++)
      |                         ~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 6 ms 1832 KB Output is correct
4 Correct 146 ms 1868 KB Output is correct
5 Correct 141 ms 1760 KB Output is correct
6 Correct 7 ms 1868 KB Output is correct
7 Correct 7 ms 1868 KB Output is correct
8 Correct 2 ms 1484 KB Output is correct
9 Correct 1 ms 1484 KB Output is correct
10 Correct 1 ms 1484 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 6 ms 1832 KB Output is correct
4 Correct 146 ms 1868 KB Output is correct
5 Correct 141 ms 1760 KB Output is correct
6 Correct 7 ms 1868 KB Output is correct
7 Correct 7 ms 1868 KB Output is correct
8 Correct 2 ms 1484 KB Output is correct
9 Correct 1 ms 1484 KB Output is correct
10 Correct 1 ms 1484 KB Output is correct
11 Correct 152 ms 1860 KB Output is correct
12 Correct 162 ms 1848 KB Output is correct
13 Correct 1 ms 1484 KB Output is correct
14 Correct 142 ms 1740 KB Output is correct
15 Correct 1 ms 1484 KB Output is correct
16 Correct 7 ms 1900 KB Output is correct
17 Correct 1 ms 1484 KB Output is correct
18 Correct 7 ms 1868 KB Output is correct
19 Correct 1 ms 1484 KB Output is correct
20 Correct 2 ms 1600 KB Output is correct
21 Correct 2 ms 1596 KB Output is correct
22 Correct 2 ms 1484 KB Output is correct
23 Correct 4 ms 1888 KB Output is correct
24 Correct 2 ms 1500 KB Output is correct
25 Correct 4 ms 1868 KB Output is correct
26 Correct 5 ms 1868 KB Output is correct
27 Correct 5 ms 1740 KB Output is correct
28 Correct 5 ms 1872 KB Output is correct
29 Correct 4 ms 1740 KB Output is correct
30 Correct 56 ms 1868 KB Output is correct
31 Correct 5 ms 1868 KB Output is correct
32 Correct 59 ms 1868 KB Output is correct
33 Correct 5 ms 1868 KB Output is correct
34 Correct 6 ms 1876 KB Output is correct
35 Correct 3 ms 1612 KB Output is correct
36 Correct 3 ms 1612 KB Output is correct
37 Correct 4 ms 1632 KB Output is correct
38 Correct 3 ms 1612 KB Output is correct
39 Correct 3 ms 1612 KB Output is correct
40 Correct 7 ms 2016 KB Output is correct
41 Correct 3 ms 1612 KB Output is correct
42 Correct 5 ms 1996 KB Output is correct
43 Correct 5 ms 2040 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 1 ms 1484 KB Output is correct
4 Correct 1 ms 1484 KB Output is correct
5 Incorrect 1 ms 1484 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 6 ms 1832 KB Output is correct
4 Correct 146 ms 1868 KB Output is correct
5 Correct 141 ms 1760 KB Output is correct
6 Correct 7 ms 1868 KB Output is correct
7 Correct 7 ms 1868 KB Output is correct
8 Correct 2 ms 1484 KB Output is correct
9 Correct 1 ms 1484 KB Output is correct
10 Correct 1 ms 1484 KB Output is correct
11 Correct 152 ms 1860 KB Output is correct
12 Correct 162 ms 1848 KB Output is correct
13 Correct 1 ms 1484 KB Output is correct
14 Correct 142 ms 1740 KB Output is correct
15 Correct 1 ms 1484 KB Output is correct
16 Correct 7 ms 1900 KB Output is correct
17 Correct 1 ms 1484 KB Output is correct
18 Correct 7 ms 1868 KB Output is correct
19 Correct 1 ms 1484 KB Output is correct
20 Correct 2 ms 1600 KB Output is correct
21 Correct 2 ms 1596 KB Output is correct
22 Correct 2 ms 1484 KB Output is correct
23 Correct 4 ms 1888 KB Output is correct
24 Correct 2 ms 1500 KB Output is correct
25 Correct 4 ms 1868 KB Output is correct
26 Correct 5 ms 1868 KB Output is correct
27 Correct 5 ms 1740 KB Output is correct
28 Correct 5 ms 1872 KB Output is correct
29 Correct 4 ms 1740 KB Output is correct
30 Correct 56 ms 1868 KB Output is correct
31 Correct 5 ms 1868 KB Output is correct
32 Correct 59 ms 1868 KB Output is correct
33 Correct 5 ms 1868 KB Output is correct
34 Correct 6 ms 1876 KB Output is correct
35 Correct 3 ms 1612 KB Output is correct
36 Correct 3 ms 1612 KB Output is correct
37 Correct 4 ms 1632 KB Output is correct
38 Correct 3 ms 1612 KB Output is correct
39 Correct 3 ms 1612 KB Output is correct
40 Correct 7 ms 2016 KB Output is correct
41 Correct 3 ms 1612 KB Output is correct
42 Correct 5 ms 1996 KB Output is correct
43 Correct 5 ms 2040 KB Output is correct
44 Incorrect 8 ms 2472 KB Output isn't correct
45 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 6 ms 1832 KB Output is correct
4 Correct 146 ms 1868 KB Output is correct
5 Correct 141 ms 1760 KB Output is correct
6 Correct 7 ms 1868 KB Output is correct
7 Correct 7 ms 1868 KB Output is correct
8 Correct 2 ms 1484 KB Output is correct
9 Correct 1 ms 1484 KB Output is correct
10 Correct 1 ms 1484 KB Output is correct
11 Correct 152 ms 1860 KB Output is correct
12 Correct 162 ms 1848 KB Output is correct
13 Correct 1 ms 1484 KB Output is correct
14 Correct 142 ms 1740 KB Output is correct
15 Correct 1 ms 1484 KB Output is correct
16 Correct 7 ms 1900 KB Output is correct
17 Correct 1 ms 1484 KB Output is correct
18 Correct 7 ms 1868 KB Output is correct
19 Correct 1 ms 1484 KB Output is correct
20 Correct 2 ms 1600 KB Output is correct
21 Correct 2 ms 1596 KB Output is correct
22 Correct 2 ms 1484 KB Output is correct
23 Correct 4 ms 1888 KB Output is correct
24 Correct 2 ms 1500 KB Output is correct
25 Correct 4 ms 1868 KB Output is correct
26 Correct 5 ms 1868 KB Output is correct
27 Correct 5 ms 1740 KB Output is correct
28 Correct 5 ms 1872 KB Output is correct
29 Correct 4 ms 1740 KB Output is correct
30 Correct 56 ms 1868 KB Output is correct
31 Correct 5 ms 1868 KB Output is correct
32 Correct 59 ms 1868 KB Output is correct
33 Correct 5 ms 1868 KB Output is correct
34 Correct 6 ms 1876 KB Output is correct
35 Correct 3 ms 1612 KB Output is correct
36 Correct 3 ms 1612 KB Output is correct
37 Correct 4 ms 1632 KB Output is correct
38 Correct 3 ms 1612 KB Output is correct
39 Correct 3 ms 1612 KB Output is correct
40 Correct 7 ms 2016 KB Output is correct
41 Correct 3 ms 1612 KB Output is correct
42 Correct 5 ms 1996 KB Output is correct
43 Correct 5 ms 2040 KB Output is correct
44 Correct 2 ms 1484 KB Output is correct
45 Incorrect 105 ms 10004 KB Output isn't correct
46 Halted 0 ms 0 KB -