| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1298660 | tab | Geppetto (COCI15_geppetto) | C++20 | 6 ms | 580 KiB |
#include "bits/stdc++.h"
using namespace std;
#define intt int
#define fi first
#define se second
const intt mxN = 1e5 + 5;
const intt LG = 20;
const intt inf = 1e18;
const intt mod = 10007;
intt n, m;
vector<pair<intt,intt>> v;
void _() {
cin >> n >> m;
for(intt i = 0; i < m; i++) {
intt a, b;
cin >> a >> b;
--a; --b;
v.push_back({a, b});
}
intt ans= 0;
for(intt mask = 0; mask < (1 << n); mask ++) {
intt f = 0;
for(intt i = 0; i < m; i++) {
intt a = v[i].first, b = v[i].second;
if(((1 << a) & mask) && ((1 << b) & mask)) {
f = 1;
break;
}
}
if(!f) {
ans++;
// for(intt i = 0; i < n; i++) {
// cout << (((1 << i) & mask) > 0);
// }
// cout << endl;
}
}
cout << ans << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
intt t = 1, buu = 1;
// cin >> t;
while(t--){
// cout << "Case #" << buu++ << ": ";
_();
}
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
