제출 #288183

#제출 시각아이디문제언어결과실행 시간메모리
288183leductoanGeppetto (COCI15_geppetto)C++14
80 / 80
393 ms504 KiB
#include<bits/stdc++.h> using namespace std; #define task "GEPPETTO" #define lb lower_bound #define ub upper_bound #define ALL(v) (v).begin(),(v).end() #define zs(v) (int)(v).size() #define fi first #define se second #define pb push_back #define mp make_pair #define cntbit __builtin_popcountll typedef long double ld; typedef long long ll; typedef pair<int,int> pii; const int d4i[4]={-1, 0, 1, 0}, d4j[4]={0, 1, 0, -1}; const int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1}; const ll mod=1000000007; /// 998244353 const int base=311; const int N=20+5; int dd[25][25],cnt,n,m,q[N]; set<int> s[25]; void biot() { cin>>n>>m; for(int i=1;i<=m;++i) { int u,v; cin>>u>>v; dd[u][v]=1; dd[v][u]=1; } int ans=0; for(int mask=0;mask<(1<<n);++mask) { int ok=1; vector<int> v; v.clear(); for(int i=1;i<=n;++i) if(mask>>(i-1)&1) v.pb(i); for(int i=0;i<zs(v);++i) { for(int j=i+1;j<zs(v);++j) { if(dd[v[i]][v[j]]) { ok=0; break; } } if(!ok) break; } ans+=ok; } cout<<ans; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); if(fopen(task".inp","r")) { freopen(task".inp","r",stdin); freopen(task".out","w",stdout); } biot(); }

컴파일 시 표준 에러 (stderr) 메시지

geppetto.cpp: In function 'int main()':
geppetto.cpp:63:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   63 |         freopen(task".inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
geppetto.cpp:64:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   64 |         freopen(task".out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...