Skip to content

Instantly share code, notes, and snippets.

View benblack769's full-sized avatar

Benjamin Black benblack769

View GitHub Profile
@benblack769
benblack769 / tree.py
Last active September 16, 2016 03:16
MAXN = 1429
HtoN = [1,2]
while HtoN[-1] <= MAXN*20:
HtoN.append(HtoN[-1] + HtoN[-2] + 1)
argvar = 0
NtoH = [-1]
#include <iostream>
#include <sstream>
using namespace std;
string next_line(){
//breaks if there is no line to get
string line;
getline(cin,line);
return line;
}
vector<string> get_lines_until_end(){
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <cstdio>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <cmath>
#include <set>
#include <iostream>
#include <cmath>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <sstream>
#include <array>
using namespace std;
import copy
#table=[[[None]*101]*101]*101
table = [[[None for k in range(101)] for j in range(101)] for i in range(101)]
table[0][0][0] = True
data_table = [[[None for k in range(101)] for j in range(101)] for i in range(101)]
def vals(coord0,coord1,coord2):
t0 = table[coord0]
t1 = t0[coord1]
table = [5,11,17,29,35,53,65,83,95,125,137,173,191,215,239,287,305,359,383,419,449,515,539,599,635,689,725,809,833,923,971,1031,1079,1151,1187,1295,1349,1421,1469,1589,1625,1751,1811,1883,1949,2087,2135,2261,2321,2417,2489,2645,2699,2819,2891,2999,3083,3257,3305,3485,3575,3683,3779,3923,3983,4181,4277,4409,4481,4691,4763,4979,5087,5207,5315,5495,5567,5801,5897,6059,6179,6425,6497,6689,6815,6983,7103,7367,7439,7655,7787,7967,8105,8321,8417,8705,8831,9011,9131,9431,9527,9833,9977,10121,10277,10595,10703,11027,11147,11363,11507,11843,11951,12215,12383,12599,12773,13061,13157,13487,13667,13907,14087,14387,14495,14873,15065,15317,15461,15851,15971,16295,16493,16709,16901,17309,17441,17855,17999,18275,18485,18845,18989,19325,19541,19793,20009,20453,20573,21023,21239,21527,21707,22067,22211,22679,22913,23225,23417,23813,23975,24461,24701,24941,25187,25685,25829,26297,26489,26813,27065,27581,27749,28109,28349,28697,28961,29495,29639,30179,30395,30755,31019,31451,31631,32111,32387,32711,32927,33497,33689,34265,34553,3
#include <iostream>
#include <cmath>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <sstream>
#include <algorithm>
#include <array>
#include <cassert>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
typedef vector<int> vi;
typedef long long LL;
LL cube(LL x){
return x*x*x;
names = int(input())
name_data = []
for _ in range(names):
data = input().split()
name = data[0][:-1] #removes colon from input
orddata = [s[0] for s in data[1:-1]] #gets a list of the first character of every word (note that 'u' > 'm' > 'l')
orddata.reverse() #string lexical comparison works from start to finish, this sort works from finish to start, so reverse it
name_str = "".join(orddata)
name_str += "m" #adding m gives the default "unnamed is medium" behaviour
name_data.append((name_str,name))
#include <vector>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <queue>
#include <array>
#include <string>
using namespace std;