Submission #83698

# Submission time Handle Problem Language Result Execution time Memory
83698 2018-11-10T00:35:37 Z jvalsortav Geppetto (COCI15_geppetto) C++14
0 / 80
1000 ms 25708 KB
#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

geppetto.cpp: In function 'int bin(long long int, int)':
geppetto.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
 } 
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 184 ms 760 KB Output isn't correct
2 Incorrect 40 ms 760 KB Output isn't correct
3 Execution timed out 1078 ms 23992 KB Time limit exceeded
4 Execution timed out 1064 ms 23992 KB Time limit exceeded
5 Execution timed out 1080 ms 25708 KB Time limit exceeded
6 Execution timed out 1079 ms 25708 KB Time limit exceeded
7 Execution timed out 1086 ms 25708 KB Time limit exceeded
8 Execution timed out 1069 ms 25708 KB Time limit exceeded
9 Execution timed out 1087 ms 25708 KB Time limit exceeded
10 Execution timed out 1082 ms 25708 KB Time limit exceeded