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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Author: Ryoma SHINYA | |
def sfunc(a, b): | |
p = bin((a + b) & 0x7F).count("1") | |
a = a + b % 256 | |
b = (a >> 6) & 0x03 | |
a = (a << 2) % 256 | |
return (a | b, p) |
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
struct Transition { | |
int t[256]; | |
Transition(int fill = REJECT) { std::fill(t, t+256, fill); } | |
int &operator[](std::size_t index) { return t[index]; } | |
const int &operator[](std::size_t index) const { t[index]; } // <- forget 'return' stmt. | |
} |
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
checking for a thread-safe mkdir -p... ../../../gcc-4.5.3/libgomp/../install-sh -c -d | |
checking for gawk... awk | |
checking whether make sets $(MAKE)... yeschecking for x86_64-apple-darwin10.7.0-gcc... /Users/ryoma/dev/compiler/build-gcc-4.5.3/./gcc/xgcc -B/Users/ryoma/dev/compiler/build-gcc-4.5.3/./gcc/ -B/Users/ryoma/dev/compiler/build-gcc-4.5.3/INSTALL_DIR/x86_64-apple-darwin10.7.0/bin/ -B/Users/ryoma/dev/compiler/build-gcc-4.5.3/INSTALL_DIR/x86_64-apple-darwin10.7.0/lib/ -isystem /Users/ryoma/dev/compiler/build-gcc-4.5.3/INSTALL_DIR/x86_64-apple-darwin10.7.0/include -isystem /Users/ryoma/dev/compiler/build-gcc-4.5.3/INSTALL_DIR/x86_64-apple-darwin10.7.0/sys-includechecking for C compiler default output file name... | |
configure: error: in `/Users/ryoma/dev/compiler/build-gcc-4.5.3/x86_64-apple-darwin10.7.0/libgomp':configure: error: C compiler cannot create executablesSee `config.log' for more details. | |
make[1]: *** [configure-target-libgomp] Error 1make: *** [all] Error 2 |
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
../gcc-4.6-20110305/configure --disable-boostrap --program-suffix=-4.6 --prefix=$HOME/opt --disable-nls --disable-multilib --enable-languages=c,c++ |
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
#http://googledevjp.blogspot.com/2011/04/google-code-jam-2011.html | |
def solve(rest, boards, counts): | |
if boards == []: | |
return rest == 0 | |
board = boards[-1] | |
count = rest / board | |
rest = rest % board | |
while count >= 0: | |
if solve(rest, boards[0:-1], counts): |
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
void | |
reject(UCHARP beg, UCHARP buf, UCHARP end, ENVP env){ | |
if (buf >= end) { | |
if (env->print_count) { | |
if (env->filename) { | |
printf("%s:", env->filename); | |
} | |
printf("%d\n", env->count); | |
} | |
return; |