제출 #1283489

#제출 시각아이디문제언어결과실행 시간메모리
1283489uranhishigGeppetto (COCI15_geppetto)C++20
48 / 80
1097 ms580 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #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; pair<int, int> p[m]; rep(i,m){ cin >> p[i].first >> p[i].second; } int ans = 0; for (int i = 0; i < (1<<n); i++){ set<int>st; for (int j = 0; j < n; j++) { if((i>>j)%2){ st.insert(j + 1); } } bool b = true; rep(i,m){ if(st.find(p[i].first)==st.end() and st.find(p[i].second)==st.end()){ b = false; } } if(b) ans++; } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...