Submission #208397

#TimeUsernameProblemLanguageResultExecution timeMemory
208397ArKCaGeppetto (COCI15_geppetto)C++17
80 / 80
7 ms380 KiB
#include<bits/stdc++.h> #define pb push_back #define ll long long #define int ll #define fri(a) freopen(a,"r",stdin); #define fro(a) freopen(a,"w",stdout); using namespace std; int n,m,a,b,ans; vector<int>v[50]; void fun(int x,int y){ ans++; // printf("%d\n", x); if(y==(n+1)) return ; int flag=0; for(int i=y;i<=n;i++){ flag=0; for(int j=0;j<v[i].size();j++){ if(((1<<v[i][j])&x)!=0){ flag=1; } } if(flag==0) fun(x^(1<<i),i+1); } } int32_t main(){ //fri("in.txt"); //fro("out.txt"); cin>>n>>m;/**/ for(int i=0;i<m;i++){ scanf("%lld %lld",&a,&b); v[a].pb(b); v[b].pb(a); } fun(0,1); cout<<ans<<endl; }

Compilation message (stderr)

geppetto.cpp: In function 'void fun(long long int, long long int)':
geppetto.cpp:19:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<v[i].size();j++){
               ~^~~~~~~~~~~~
geppetto.cpp: In function 'int32_t main()':
geppetto.cpp:33:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld",&a,&b);
   ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...