Skip to content

Instantly share code, notes, and snippets.

View whs's full-sized avatar

Manatsawin Hanmongkolchai whs

View GitHub Profile
from cjlib.input import *
from cjlib.runner import TaskRunner, DummyRunner, MPQRunner
import logging
logging.basicConfig(level=logging.INFO)
def process(case):
# all units in pi cm^2
paintLeft = case[1]
canDraw = 0
@whs
whs / chal.py
Last active December 19, 2015 04:18 — forked from anonymous/chal.py
from __future__ import division
import math
def s(a,b,c,e=1):
try:
p2 = math.sqrt(b**2 - (4*a*c))
return ((-1*b)+p2)/(a*2) if e>0 else ((-1*b)-p2)/(a*2)
except ValueError:
return None
def smaller_root(a,b,c):