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
import re | |
import sys | |
from PIL import Image | |
with open("data.txt") as f: | |
lines = f.readlines() | |
"""u = -3 * x + 95 * y; z = -0.12652202789462033 + 0.006530883329643569 * i | |
v = -65 * x + 5 * y; z = -0.16588235294117648 + 0.04352941176470588 * i""" |
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
import binascii | |
import socket | |
import sys | |
HOST = 'challs.xmas.htsp.ro' | |
PORT = 1002 | |
# Come up with a way to encode a word into a number, and binary search. | |
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
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
import socket | |
HOST = 'challs.xmas.htsp.ro' | |
PORT = 6001 | |
log = open("net.log", "wb") | |
def send(s, data): | |
if isinstance(data, str): | |
data = bytearray(data, 'ascii') |
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
from __future__ import division | |
from itertools import permutations | |
def solve(nums, target): | |
ops = [("+", lambda x,y: x+y), | |
("/", lambda x,y: x/y), | |
("*", lambda x,y: x*y), | |
("-", lambda x,y: x-y)] | |
closest = 1000 | |
curr_op = "" |