This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
#define max(a,b) ((a>b)?a:b) | |
#define timeit(a,b){ \ | |
start=clock(); \ | |
a; \ | |
end=clock(); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isBigRect(rectangles): | |
if rectangles==[]: | |
return True | |
L=processBoundaries(rectangles,leftOrRight='left') | |
R=processBoundaries(rectangles,leftOrRight='right') | |
# print L, R | |
if L==False or R==False or not len(L)==len(R): | |
return False | |
L[-1][0]=R[-1][0] | |
R[0][0]=L[0][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
void print_bits(uint32_t x); | |
uint32_t uint32_smear_right(uint32_t x){ | |
x = x | x>>1; | |
x = x | x>>2; | |
x = x | x>>4; | |
x = x | x>>8; |