Skip to content

Instantly share code, notes, and snippets.

@aycabta
Created February 19, 2014 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aycabta/9088471 to your computer and use it in GitHub Desktop.
Save aycabta/9088471 to your computer and use it in GitHub Desktop.
#define R { return
#define P P (
#define L L (
#define T S (v, y, c,
#define C ),
#define X x)
#define F );}
int r, a;
P y, X
R y - ~y << x;
}
Z (X
R r = x % 2 ? 0 : 1 + Z (x / 2 F
L X
R x / 2 >> Z (x F
#define U = S(4,13,-4,
T t)
{
int
f = L t C
x = r;
R
f - 2 ?
f > 2 ?
f - v ? t - (f > v) * c : y :
P f, P T L X C
S (v+2, t U y C c, Z (X )))
:
A (T L X C
T Z (X ) F
}
A (y, X
R L y) - 1
? 5 << P y, X
: S (4, x, 4, Z (r) F
#define B (x /= 2) % 2 && (
D (X
{
int
f,
d,
c = 0,
t = 7,
u = 14;
while (x && D (x - 1 C B 1))
d = L L D (X ) C
f = L r C
x = L r C
c - r || (
L u) || L r) - f ||
B u = S (4, d, 4, r C
t = A (t, d) C
f / 2 & B c = P d, c C
t U t C
u U u) )
C
c && B
t = P
~u & 2 | B
u = 1 << P L c C u) C
P L c C t) C
c = r C
u / 2 & B
c = P t, c C
u U t C
t = 9 );
R a = P P t, P u, P x, c)) C
a F
}
main ()
R D (D (D (D (D (99)))) F
int r, a;
P ( y, x)
{ return y - ~y << x;
}
Z (x)
{ return r = x % 2 ? 0 : 1 + Z (x / 2 );}
L ( x)
{ return x / 2 >> Z (x );}
S (v, y, c, t)
{
int
f = L ( t ),
x = r;
{ return
f - 2 ?
f > 2 ?
f - v ? t - (f > v) * c : y :
P ( f, P ( S (v, y, c, L ( x) ),
S (v+2, t = S(4,13,-4, y ), c, Z (x) )))
:
A (S (v, y, c, L ( x) ),
S (v, y, c, Z (x) ) );}
}
A (y, x)
{ return L ( y) - 1
? 5 << P ( y, x)
: S (4, x, 4, Z (r) );}
D (x)
{
int
f,
d,
c = 0,
t = 7,
u = 14;
while (x && D (x - 1 ), (x /= 2) % 2 && ( 1))
d = L ( L ( D (x) ) ),
f = L ( r ),
x = L ( r ),
c - r || (
L ( u) || L ( r) - f ||
(x /= 2) % 2 && ( u = S (4, d, 4, r ),
t = A (t, d) ),
f / 2 & (x /= 2) % 2 && ( c = P ( d, c ),
t = S(4,13,-4, t ),
u = S(4,13,-4, u) )
),
c && (x /= 2) % 2 && (
t = P (
~u & 2 | (x /= 2) % 2 && (
u = 1 << P ( L ( c ), u) ),
P ( L ( c ), t) ),
c = r ),
u / 2 & (x /= 2) % 2 && (
c = P ( t, c ),
u = S(4,13,-4, t ),
t = 9 );
{ return a = P ( P ( t, P ( u, P ( x, c)) ),
a );}
}
main ()
{ return D (D (D (D (D (99)))) );}
int r, a;
P(y, x) {
return y - ~y << x;
}
Z(x) {
return r = x % 2 ? 0 : 1 + Z (x / 2);
}
L(x) {
return x / 2 >> Z (x);
}
S(v, y, c, t)
{
int f = L(t);
int x = r;
if (f - 2) {
if (f > 2) {
if (f - v) {
return t - (f > v) * c;
} else {
return y;
}
} else {
return P(f, P(S(v, y, c, L(x)), S(v + 2, t = S(4, 13, -4, y), c, Z(x))));
}
} else {
A(S(v, y, c, L(x)), S(v, y, c, Z(x)));
}
}
A(y, x) {
return L(y) - 1
? 5 << P(y, x)
: S (4, x, 4, Z(r));
}
D(x) {
int f;
int d;
int c = 0;
int t = 7;
int u = 14;
while (x && D(x - 1), (x /= 2) % 2 && (1)) {
d = L(L(D(x)));
f = L(r);
x = L(r);
c - r || (
L(u) ||
L(r) - f ||
(x /= 2) % 2 &&
(u = S(4, d, 4, r), t = A(t, d)),
f / 2 & (x /= 2) % 2 &&
(
c = P(d, c),
t = S(4, 13, -4, t),
u = S(4, 13, -4, u)
)
),
c && (x /= 2) % 2 &&
(
t = P(
~u & 2 | (x /= 2) % 2 &&
(u = 1 << P(L(c), u)),
P(L(c), t)
),
c = r
),
u / 2 & (x /= 2) % 2 &&
(
c = P(t, c),
u = S(4, 13, -4, t),
t = 9
);
{
return a = P(P(t, P(u, P(x, c))), a);
}
}
main() {
return D(D(D(D(D(99)))));
}
int r, a;
P(y, x) {
return y - ~y << x;
}
Z(x) {
if (r = x % 2) {
return 0;
} else {
return 1 + Z (x / 2);
}
L(x) {
return x / 2 >> Z (x );
}
S(v, y, c, t)
{
int f = L(t);
int x = r;
if (f - 2) {
if (f > 2) {
if (f - v) {
return t - (f > v) * c;
} else {
return y;
}
} else {
return P(f, P(S(v, y, c, L(x)), S(v + 2, t = S(4, 13, -4, y), c, Z(x))));
}
} else {
A(S(v, y, c, L(x)), S(v, y, c, Z(x)));
}
}
A(y, x) {
if (L(y) - 1) {
return 5 << P(y, x);
} else {
return S(4, x, 4, Z(r));
}
}
D(x) {
int f;
int d;
int c = 0;
int t = 7;
int u = 14;
while (1) {
if (x) {
D(x - 1);
}
if ((x /= 2) % 2) {
break;
}
d = L(L(D(x)));
f = L(r);
x = L(r);
if (!(c - r)) {
if (!L(u)) {
if (!(L(r) - f)) {
if ((x /= 2) % 2) {
u = S(4, d, 4, r);
t = A(t, d);
if (f / 2 & (x /= 2) % 2) {
c = P(d, c);
t = S(4, 13, -4, t);
u = S(4, 13, -4, u);
}
}
}
}
};
if (c) {
if ((x /= 2) % 2) {
t = P(
~u & 2 | (x /= 2) % 2 && (u = 1 << P(L(c), u)),
P(L(c), t)
);
c = r;
}
}
if (u / 2 & (x /= 2) % 2) {
c = P(t, c);
u = S(4, 13, -4, t);
t = 9;
}
}
return a = P(P(t, P(u, P(x, c))), a);
}
main() {
return D(D(D(D(D(99)))));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment