답안 #245058

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
245058 2020-07-05T11:33:51 Z m3r8 Political Development (BOI17_politicaldevelopment) C++14
77 / 100
3000 ms 31736 KB
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <set>

#define N 50100


std::set<int> tst[N];
std::vector<int> adj[N];

int clq(std::vector<int> akt, int depth, int idx){
  if(!akt.size())return depth;
  else{
    int mx = 0;
    for(int i = 0;i<akt.size();i++){
      std::vector<int> nxt;  
      for(int j = i+1;j<akt.size();j++){
        if(tst[akt[i]].count(akt[j])){
          nxt.push_back(akt[j]);  
        };
      };
      mx = std::max(mx,clq(nxt,depth+1,idx));
    };
    return mx;
  };
};

int main(void){
  int n,k;  
  scanf("%d %d",&n,&k);

  int d;
  int x;
  for(int i = 0;i<n;i++){
    scanf("%d",&d);
    for(int j = 0;j<d;j++){
      scanf("%d",&x);
      adj[i].push_back(x);
      tst[i].insert(x);
    };
  };
  int mx = 0;
  for(int i = 0;i<n;i++){
    int tmp = clq(adj[i],1,i);
    //printf("%d %d %d\n",i,tmp,adj[i].size());
    mx = std::max(tmp,mx);
  };
  printf("%d\n",mx);
  return 0;
};

Compilation message

politicaldevelopment.cpp: In function 'int clq(std::vector<int>, int, int)':
politicaldevelopment.cpp:16:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0;i<akt.size();i++){
                   ~^~~~~~~~~~~
politicaldevelopment.cpp:18:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int j = i+1;j<akt.size();j++){
                       ~^~~~~~~~~~~
politicaldevelopment.cpp: In function 'int main()':
politicaldevelopment.cpp:31:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&n,&k);
   ~~~~~^~~~~~~~~~~~~~~
politicaldevelopment.cpp:36:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&d);
     ~~~~~^~~~~~~~~
politicaldevelopment.cpp:38:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
       scanf("%d",&x);
       ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 3840 KB Output is correct
2 Correct 6 ms 3840 KB Output is correct
3 Correct 12 ms 4480 KB Output is correct
4 Correct 92 ms 4608 KB Output is correct
5 Correct 101 ms 4608 KB Output is correct
6 Correct 12 ms 4608 KB Output is correct
7 Correct 12 ms 4608 KB Output is correct
8 Correct 7 ms 3840 KB Output is correct
9 Correct 6 ms 3840 KB Output is correct
10 Correct 7 ms 3840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 3840 KB Output is correct
2 Correct 6 ms 3840 KB Output is correct
3 Correct 12 ms 4480 KB Output is correct
4 Correct 92 ms 4608 KB Output is correct
5 Correct 101 ms 4608 KB Output is correct
6 Correct 12 ms 4608 KB Output is correct
7 Correct 12 ms 4608 KB Output is correct
8 Correct 7 ms 3840 KB Output is correct
9 Correct 6 ms 3840 KB Output is correct
10 Correct 7 ms 3840 KB Output is correct
11 Correct 83 ms 4600 KB Output is correct
12 Correct 91 ms 4608 KB Output is correct
13 Correct 6 ms 3840 KB Output is correct
14 Correct 111 ms 4728 KB Output is correct
15 Correct 6 ms 3840 KB Output is correct
16 Correct 11 ms 4608 KB Output is correct
17 Correct 6 ms 3840 KB Output is correct
18 Correct 13 ms 4608 KB Output is correct
19 Correct 7 ms 3888 KB Output is correct
20 Correct 9 ms 4224 KB Output is correct
21 Correct 11 ms 4352 KB Output is correct
22 Correct 8 ms 3840 KB Output is correct
23 Correct 11 ms 4608 KB Output is correct
24 Correct 7 ms 3840 KB Output is correct
25 Correct 12 ms 4608 KB Output is correct
26 Correct 11 ms 4608 KB Output is correct
27 Correct 10 ms 4480 KB Output is correct
28 Correct 11 ms 4608 KB Output is correct
29 Correct 10 ms 4480 KB Output is correct
30 Correct 37 ms 4736 KB Output is correct
31 Correct 11 ms 4736 KB Output is correct
32 Correct 36 ms 4736 KB Output is correct
33 Correct 12 ms 4736 KB Output is correct
34 Correct 13 ms 4864 KB Output is correct
35 Correct 10 ms 4224 KB Output is correct
36 Correct 10 ms 4352 KB Output is correct
37 Correct 9 ms 4224 KB Output is correct
38 Correct 9 ms 4096 KB Output is correct
39 Correct 9 ms 4096 KB Output is correct
40 Correct 15 ms 4992 KB Output is correct
41 Correct 9 ms 4096 KB Output is correct
42 Correct 17 ms 5120 KB Output is correct
43 Correct 17 ms 5120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 3840 KB Output is correct
2 Correct 6 ms 3840 KB Output is correct
3 Correct 7 ms 3840 KB Output is correct
4 Correct 6 ms 3840 KB Output is correct
5 Correct 6 ms 3840 KB Output is correct
6 Correct 7 ms 3840 KB Output is correct
7 Correct 6 ms 3840 KB Output is correct
8 Correct 7 ms 3840 KB Output is correct
9 Correct 6 ms 3840 KB Output is correct
10 Correct 7 ms 3840 KB Output is correct
11 Correct 313 ms 31480 KB Output is correct
12 Correct 8 ms 3968 KB Output is correct
13 Correct 308 ms 31608 KB Output is correct
14 Correct 6 ms 3840 KB Output is correct
15 Correct 308 ms 31640 KB Output is correct
16 Correct 308 ms 31484 KB Output is correct
17 Correct 310 ms 31608 KB Output is correct
18 Correct 310 ms 31736 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 3840 KB Output is correct
2 Correct 6 ms 3840 KB Output is correct
3 Correct 12 ms 4480 KB Output is correct
4 Correct 92 ms 4608 KB Output is correct
5 Correct 101 ms 4608 KB Output is correct
6 Correct 12 ms 4608 KB Output is correct
7 Correct 12 ms 4608 KB Output is correct
8 Correct 7 ms 3840 KB Output is correct
9 Correct 6 ms 3840 KB Output is correct
10 Correct 7 ms 3840 KB Output is correct
11 Correct 83 ms 4600 KB Output is correct
12 Correct 91 ms 4608 KB Output is correct
13 Correct 6 ms 3840 KB Output is correct
14 Correct 111 ms 4728 KB Output is correct
15 Correct 6 ms 3840 KB Output is correct
16 Correct 11 ms 4608 KB Output is correct
17 Correct 6 ms 3840 KB Output is correct
18 Correct 13 ms 4608 KB Output is correct
19 Correct 7 ms 3888 KB Output is correct
20 Correct 9 ms 4224 KB Output is correct
21 Correct 11 ms 4352 KB Output is correct
22 Correct 8 ms 3840 KB Output is correct
23 Correct 11 ms 4608 KB Output is correct
24 Correct 7 ms 3840 KB Output is correct
25 Correct 12 ms 4608 KB Output is correct
26 Correct 11 ms 4608 KB Output is correct
27 Correct 10 ms 4480 KB Output is correct
28 Correct 11 ms 4608 KB Output is correct
29 Correct 10 ms 4480 KB Output is correct
30 Correct 37 ms 4736 KB Output is correct
31 Correct 11 ms 4736 KB Output is correct
32 Correct 36 ms 4736 KB Output is correct
33 Correct 12 ms 4736 KB Output is correct
34 Correct 13 ms 4864 KB Output is correct
35 Correct 10 ms 4224 KB Output is correct
36 Correct 10 ms 4352 KB Output is correct
37 Correct 9 ms 4224 KB Output is correct
38 Correct 9 ms 4096 KB Output is correct
39 Correct 9 ms 4096 KB Output is correct
40 Correct 15 ms 4992 KB Output is correct
41 Correct 9 ms 4096 KB Output is correct
42 Correct 17 ms 5120 KB Output is correct
43 Correct 17 ms 5120 KB Output is correct
44 Correct 121 ms 6144 KB Output is correct
45 Correct 7 ms 3840 KB Output is correct
46 Correct 16 ms 5248 KB Output is correct
47 Correct 28 ms 6144 KB Output is correct
48 Correct 15 ms 4992 KB Output is correct
49 Correct 29 ms 6144 KB Output is correct
50 Correct 27 ms 6144 KB Output is correct
51 Correct 74 ms 8536 KB Output is correct
52 Correct 53 ms 4608 KB Output is correct
53 Correct 1841 ms 9208 KB Output is correct
54 Correct 89 ms 9080 KB Output is correct
55 Correct 11 ms 4608 KB Output is correct
56 Correct 42 ms 4600 KB Output is correct
57 Correct 7 ms 3840 KB Output is correct
58 Correct 1886 ms 9248 KB Output is correct
59 Correct 19 ms 4992 KB Output is correct
60 Correct 11 ms 4480 KB Output is correct
61 Correct 18 ms 4992 KB Output is correct
62 Correct 18 ms 4992 KB Output is correct
63 Correct 122 ms 6144 KB Output is correct
64 Correct 75 ms 5932 KB Output is correct
65 Correct 14 ms 4864 KB Output is correct
66 Correct 18 ms 4992 KB Output is correct
67 Correct 59 ms 6656 KB Output is correct
68 Correct 76 ms 5888 KB Output is correct
69 Correct 13 ms 4864 KB Output is correct
70 Correct 28 ms 6016 KB Output is correct
71 Correct 59 ms 6656 KB Output is correct
72 Correct 44 ms 6528 KB Output is correct
73 Correct 12 ms 4480 KB Output is correct
74 Correct 27 ms 6016 KB Output is correct
75 Correct 45 ms 6528 KB Output is correct
76 Correct 53 ms 5376 KB Output is correct
77 Correct 37 ms 7168 KB Output is correct
78 Correct 10 ms 4480 KB Output is correct
79 Correct 24 ms 5632 KB Output is correct
80 Correct 55 ms 5504 KB Output is correct
81 Correct 36 ms 7168 KB Output is correct
82 Correct 10 ms 4096 KB Output is correct
83 Correct 23 ms 5504 KB Output is correct
84 Correct 28 ms 6528 KB Output is correct
85 Correct 9 ms 4096 KB Output is correct
86 Correct 28 ms 6528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 3840 KB Output is correct
2 Correct 6 ms 3840 KB Output is correct
3 Correct 12 ms 4480 KB Output is correct
4 Correct 92 ms 4608 KB Output is correct
5 Correct 101 ms 4608 KB Output is correct
6 Correct 12 ms 4608 KB Output is correct
7 Correct 12 ms 4608 KB Output is correct
8 Correct 7 ms 3840 KB Output is correct
9 Correct 6 ms 3840 KB Output is correct
10 Correct 7 ms 3840 KB Output is correct
11 Correct 83 ms 4600 KB Output is correct
12 Correct 91 ms 4608 KB Output is correct
13 Correct 6 ms 3840 KB Output is correct
14 Correct 111 ms 4728 KB Output is correct
15 Correct 6 ms 3840 KB Output is correct
16 Correct 11 ms 4608 KB Output is correct
17 Correct 6 ms 3840 KB Output is correct
18 Correct 13 ms 4608 KB Output is correct
19 Correct 7 ms 3888 KB Output is correct
20 Correct 9 ms 4224 KB Output is correct
21 Correct 11 ms 4352 KB Output is correct
22 Correct 8 ms 3840 KB Output is correct
23 Correct 11 ms 4608 KB Output is correct
24 Correct 7 ms 3840 KB Output is correct
25 Correct 12 ms 4608 KB Output is correct
26 Correct 11 ms 4608 KB Output is correct
27 Correct 10 ms 4480 KB Output is correct
28 Correct 11 ms 4608 KB Output is correct
29 Correct 10 ms 4480 KB Output is correct
30 Correct 37 ms 4736 KB Output is correct
31 Correct 11 ms 4736 KB Output is correct
32 Correct 36 ms 4736 KB Output is correct
33 Correct 12 ms 4736 KB Output is correct
34 Correct 13 ms 4864 KB Output is correct
35 Correct 10 ms 4224 KB Output is correct
36 Correct 10 ms 4352 KB Output is correct
37 Correct 9 ms 4224 KB Output is correct
38 Correct 9 ms 4096 KB Output is correct
39 Correct 9 ms 4096 KB Output is correct
40 Correct 15 ms 4992 KB Output is correct
41 Correct 9 ms 4096 KB Output is correct
42 Correct 17 ms 5120 KB Output is correct
43 Correct 17 ms 5120 KB Output is correct
44 Correct 7 ms 3840 KB Output is correct
45 Correct 215 ms 22136 KB Output is correct
46 Correct 2447 ms 13688 KB Output is correct
47 Correct 212 ms 22136 KB Output is correct
48 Correct 233 ms 22008 KB Output is correct
49 Execution timed out 3077 ms 11124 KB Time limit exceeded
50 Halted 0 ms 0 KB -