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
// | |
// Randomized KD Tree (for d = 2) | |
// | |
// even split/join require O(n) time; however | |
// insert/remove require only O(log n) time. | |
// | |
#include <iostream> | |
#include <cstdio> | |
#include <complex> |
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
// | |
// Draw a number [0...n) from a loaded dice (Vose's alias method) | |
// | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
unsigned int xor32() { | |
static unsigned long y = 2463534242UL; |
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 <iostream> | |
#include <vector> | |
#include <deque> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <map> | |
#include <cmath> | |
#include <cstring> | |
#include <functional> | |
#include <algorithm> |
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
1982/10/4 桜田淳子 | |
1982/10/5 土居甫 | |
1982/10/6 増田恵子 | |
1982/10/7 うつみ宮土理 | |
1982/10/8 和田アキ子 | |
1982/10/11 ガッツ石松 | |
1982/10/12 加藤芳郎 | |
1982/10/13 富永一朗 | |
1982/10/14 鈴木義司 | |
1982/10/15 三波豊和 |
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
# -*- coding: UTF-8 -*- | |
# | |
# source: http://www.mext.go.jp/b_menu/toukei/001/022/2003.htm | |
# | |
import random | |
import matplotlib | |
import matplotlib.pyplot as plt | |
import math | |
y = [53.14, 52.44, 54.13, 54.63, 54.40, 54.85, 51.04, 50.35, 49.29, 47.95, 47.05, 45.28, 42.62, 39.70, 36.86] |
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 <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <vector> | |
#include <ctime> | |
#include <functional> | |
#include <algorithm> | |
#include <numeric> | |
using namespace std; |
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
% --- testcase: grid network --- | |
% A: adjacency matrix | |
inf = 999999; | |
w = 4; | |
h = 4; | |
A = inf*ones(w*h); | |
n = size(D,1); | |
for x = 1 : w | |
for y = 1 : h | |
if x < w |
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://www.ncdc.noaa.gov/ghcnm/v3.php | |
// | |
#include <iostream> | |
#include <vector> | |
#include <sstream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <map> | |
#include <cmath> |
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
// nonlinear conjugate gradient | |
#include <iostream> | |
#include <vector> | |
#include <deque> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <map> | |
#include <cmath> | |
#include <cstring> |
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 <iostream> | |
#include <vector> | |
#include <deque> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <map> | |
#include <cmath> | |
#include <cstring> | |
#include <functional> | |
#include <algorithm> |