# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154045 | jvalsortav | Geppetto (COCI15_geppetto) | C++14 | 627 ms | 4572 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
#include <set>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <utility>
#include <string>
#include <map>
using namespace std;
int n, b, x, y, m, l, v;
int s[1048580];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n;
l = (1<<n);
b = l;
/*cout << s.size();*/
cin >> m;
for (int i = 0; i < m; i++){
cin >> x >> y;
for (int i = 0; i < l; i++){
if (i&(1<<(x-1)) and i&(1<<(y-1))){
/*cout << i << endl;*/
if (!s[i]) v++;
s[i]++;
}
}
}
cout << l - v;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |