Submission #88652

#TimeUsernameProblemLanguageResultExecution timeMemory
88652asifthegreatGeppetto (COCI15_geppetto)C++14
80 / 80
231 ms524 KiB
#include <bits/stdc++.h> using namespace std; int ans; int n,m; vector<int>subset; vector<int>v[100]; int mp[2000000]; void go(int i) { if(i == n+1){ int size = subset.size(); for(int i = 0; i < size;i++){ for(int j = 0; j < size;j++){ if(i == j)continue; if(find(v[subset[i]].begin(),v[subset[i]].end(),subset[j]) != v[subset[i]].end()){ ans--;return; } } } return; } if(i > 10000){ cout << "sed lyf\n";exit(0); } go(i+1); subset.push_back(i); go(i+1); subset.pop_back(); } int main() { scanf("%d%d",&n,&m); //for(int i = 0; i <= n;i++)parent[i] = i; int a,b; ans = 1<<(n); //set<pair<int,int>>st; for(int i = 1; i <= m;i++){ scanf("%d%d",&a,&b); v[a].push_back(b); v[b].push_back(a); } go(1); cout << ans << endl; return 0; }

Compilation message (stderr)

geppetto.cpp: In function 'int main()':
geppetto.cpp:36:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
geppetto.cpp:42:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&a,&b);
         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...