master
Felix C. Stegerman 2016-09-24 12:51:18 +02:00 committed by Tijdelijke Login
commit 48189cdb56
3 changed files with 45 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/[a-z]
*~
*.swp

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
CXXFLAGS=-Wall -Wextra -std=c++11
SHELL=bash
.PHONY: run
run:
make $$P && { head $$S.in | cut -c-80 ; echo ; \
time ./$$P < $$S.in ; echo \
cat $$S.ans ; echo ; \
diff -Naur <( ./$$P < $$S.in ) $$S.ans ; }
run_py:
head $$S.in | cut -c-80 ; echo ; \
time python $$P.py < $$S.in ; echo \
cat $$S.ans ; echo ; \
diff -Naur <( python $$P.py < $$S.in ) $$S.ans

25
c.py Normal file
View File

@ -0,0 +1,25 @@
from __future__ import print_function
import sys
a = map(int, sys.stdin.readline().split())
b = map(int, sys.stdin.readline().split())
c = map(int, sys.stdin.readline().split())
def mul(a, b):
x,y = a; z,w = b
return x*z + y*w
def add(a, b):
x,y = a; z,w = b
return (x+z, y+w)
def sub(a, b):
x,y = a; z,w = b
return (x-z, y-w)
if mul(sub(b, a), sub(c, a)) == 0:
print(*sub(add(c, b), a))
elif mul(sub(a, b), sub(c, b)) == 0:
print(*sub(add(a, c), b))
elif mul(sub(b, c), sub(a, c)) == 0:
print(*sub(add(a, b), c))
else:
print("WTF")