Submission #245058

#TimeUsernameProblemLanguageResultExecution timeMemory
245058m3r8Political Development (BOI17_politicaldevelopment)C++14
77 / 100
3077 ms31736 KiB
#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 (stderr)

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);
       ~~~~~^~~~~~~~~
#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...