Submission #165619

#TimeUsernameProblemLanguageResultExecution timeMemory
165619beso123Geppetto (COCI15_geppetto)C++14
80 / 80
135 ms504 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int ans=0; int n,m; vector<int> g[100]; main(){ cin>>n>>m; for(int k=1;k<=m;k++){ int a,b; cin>>a>>b; g[a].push_back(b); g[b].push_back(a); } int N=1<<(n); for(int k=0;k<=N;k++){ bitset<22> b=k; int ind=1; for(int i=0;i<n;i++){ if(b[i]) for(int j=0;j<g[i+1].size();j++){ if(b[g[i+1][j]-1]==1){ ind=0; break; } if(!ind) break; } } if(ind) ans++; } cout<<ans-1; return 0; }

Compilation message (stderr)

geppetto.cpp:7:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
geppetto.cpp: In function 'int main()':
geppetto.cpp:21:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int j=0;j<g[i+1].size();j++){
                ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...