Skip to content

Instantly share code, notes, and snippets.

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"""
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"
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')
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 = ""