제출 #1283492

#제출 시각아이디문제언어결과실행 시간메모리
1283492uranhishigGeppetto (COCI15_geppetto)C++20
0 / 80
187 ms24864 KiB
#include <bits/stdc++.h> using namespace std; #define all(a) (a).begin(),(a).end() #define rep(i, n) for(int i = 0; i < (n); i++) signed main(){ int n; cin >> n; int m; cin >> m; int cnt[2500][2500]={0}; rep(i,m){ int a, b; cin >> a >> b; cnt[a][b]=1; cnt[b][a]=1; } int ans = 0; for (int i = 0; i < (1<<n); i++){ vector<int>st; for (int j = 0; j < n; j++) { if((i>>j)%2){ st.push_back(j + 1); } } bool b = true; for (int j = 0; j < st.size(); j++) { for (int l = j + 1; l < st.size(); l++) { if(cnt[l][j] == 1) { b = 0; } } } if(b) ans++; } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...