# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83697 | jvalsortav | Geppetto (COCI15_geppetto) | C++14 | 1088 ms | 49312 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 <string>
#include <map>
using namespace std;
int n, m, x, y, a[800];
long long c = 1, r;
set <long long> s;
int bin (long long b, int e){
int i = 1;
while(b){
if(i == e){
if (b%2){
return 1;
}
else{
return 0;
}
}
b /= 2;
i++;
}
}
int main() {
cin >> n;
c = c*(2<<(n-1));
/*cout << c << endl;*/
cin >> m;
for (int i = 0; i < 2*m; i += 2){
cin >> x;
cin >> y;
for (long long j = 0; j < c; j++){
if (bin(j, x) and bin(j, y)){
/*cout << j << endl;*/
s.insert(j);
}
}
}
cout << c - s.size();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |