This file contains hidden or 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
// Count paths on a lattice graph. | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <vector> | |
#include <algorithm> | |
#include <gmp.h> |
This file contains hidden or 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
/* Generate lattice graphs. */ | |
#include "gb_graph.h" | |
#include "gb_basic.h" | |
#include "gb_save.h" | |
int main(int argc, char* argv[]) | |
{ | |
if (argc < 4) { | |
fprintf(stderr, "Usage %s N M outfile\n", argv[0]); |
This file contains hidden or 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 <iostream> | |
template<int n, int d = 2, int r = 1, bool is_prime = false> | |
struct Prime { | |
Prime() { Prime<n, (d > 2) ? ((d + 2) % 3 ? d + 2 : d + 4) : d + 1, n % d, (n < d * d)>(); } | |
}; | |
template<int n, int d> | |
struct Prime<n, d, 0, false> {}; |
This file contains hidden or 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 -*- | |
"""世界の標準時間を相互に変換""" | |
import sys, os, datetime | |
TIMEZONE_TABLE = { | |
"NZDT" : ["+13:00", u"ニュージーランド夏時間"], | |
"IDLE": ["+12:00", u"国際日付変更線の東側"], | |
"NZST": ["+12:00", u"ニュージーランド標準時間"], |
This file contains hidden or 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 <iostream> | |
#include <string> | |
#include <bitset> | |
#include <ctime> | |
using namespace std; | |
// dynamic programming | |
const int SIZE = 100; |
This file contains hidden or 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
clusters_tbb.cpp | |
// hierarchical clustering using the TBB library | |
// by nox, 2009.07.02 | |
// | |
// Linux - Intel C++ | |
// icpc clusters_tbb.cpp -O3 -ltbb -o clusters_tbb | |
// | |
// Linux - GCC | |
// g++ clusters_tbb.cpp -O3 -ltbb -o clusters_tbb |
This file contains hidden or 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 -*- | |
import sys, os, math, heapq, Image, ImageDraw | |
# Connected Component Labeling - Label Equivalence method | |
class CCL: | |
def __init__(self, imagefile, threshold, area): | |
im = Image.open(imagefile) | |
im = im.convert("RGB") |
This file contains hidden or 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
//////////////////////////////////////////////////////////////// | |
// Simple Molecular Dynamics using GPU by nox, 2009.12.10. | |
// | |
// Perform molecular dynamics for pseudo-atoms without internal | |
// interactions, such as bonds, angles, dihedrals. Only vdW and | |
// Coulomb interactions. | |
#include <iostream> | |
#include <iomanip> | |
#include <fstream> |
This file contains hidden or 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
class Place { | |
int id; | |
String name; | |
float x, y; | |
public Place(int id, String name, float x, float y) { | |
this.id = id; | |
this.name = name; | |
this.x = x; | |
this.y = y; |
This file contains hidden or 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
// Solver of Knight's Tour using Warnsdorff's algorithm and Schwenk's theorem | |
#include <iostream> | |
#include <iomanip> | |
#include <vector> | |
#include <algorithm> | |
#include <utility> | |
#include <cmath> | |
#include <cstdlib> |