s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1 value | original_language stringclasses 11 values | filename_ext stringclasses 1 value | status stringclasses 1 value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s794248160 | p00017 | u912237403 | 1393946351 | Python | Python | py | Runtime Error | 0 | 0 | 370 | import sys
def rot(s):
A="abcdefghijklmnopqrstuvwxyza"
x=""
for c in s:
try:x+=A[A.index(c)+1]
except:x+=c
return x
w=["the","that","this"]
for l in sys.stdin.readlines():
c=0
f=1
while f:
for i in range(3):
if w[i] in s:
f=0
break
else:w[i]=rot(w[i])
else:c+=1
while c-26:
s=rot(s)
c+=1
print s[:-1] |
s772567795 | p00017 | u912237403 | 1393946929 | Python | Python | py | Runtime Error | 0 | 0 | 363 | import sys
def decode(s):
x=""
for c in s:
if c in " .":
x+=c
else:
x+=chr(ord(c)+1)
return x.replace(chr(ord("z")+1),"a")
for s in sys.stdin.readlines():
for i in xrange(ord("z")-ord("a")+1):
if "the" in s or "that" in s or "this" in s:
print s[:-1]
break
s=decode(s) |
s436506531 | p00017 | u912237403 | 1393947570 | Python | Python | py | Runtime Error | 0 | 0 | 303 | import sys
A="abcdefghijklmnopqrstuvwxyza"
def decode(s):
x=""
for c in s:
if c in " .": x+=c
else: x+=A[A.index(c)+1)
return x
for s in sys.stdin.readlines():
for i in range(26):
if "the" in s or "that" in s or "this" in s:break
s=decode(s)
print s[:-1] |
s345693217 | p00017 | u912237403 | 1393947591 | Python | Python | py | Runtime Error | 0 | 0 | 303 | import sys
A="abcdefghijklmnopqrstuvwxyza"
def decode(s):
x=""
for c in s:
if c in " .": x+=c
else: x+=A[A.index(c)+1]
return x
for s in sys.stdin.readlines():
for i in range(26):
if "the" in s or "that" in s or "this" in s:break
s=decode(s)
print s[:-1] |
s630811059 | p00017 | u193025715 | 1395389611 | Python | Python | py | Runtime Error | 0 | 0 | 931 | alpha = list('abcdefghijklmnopqrstuvwxyz') * 2
def create_caesar(word, num):
new_word = ""
for s in word:
new_word += alpha[alpha.index(s) + num]
return new_word
check_the = [create_caesar('the', i) for i in range(26)]
check_this = [create_caesar('this', i) for i in range(26)]
check_that = [create_caesar('that', i) for i in range(26)]
set_the = set(check_the)
set_this = set(check_this)
set_that = set(check_that)
while True:
sentence = raw_input().split()
sentence[-1] = sentence[-1].replace('.', '')
ans = []
set_sentence = set(sentence)
if len(set_sentence & set_the)!= 0:
num = check_the.index(list(set_sentence & set_the)[0])
elif len(set_sentence & set_this)!= 0:
num = check_this.index(list(set_sentence & set_this)[0])
elif len(set_sentence & set_that)!= 0:
num = check_that.index(list(set_sentence & set_that)[0])
for s in sentence:
ans.append(create_caesar(s, -num))
print " ".join(ans) + "." |
s306304841 | p00017 | u193025715 | 1395390168 | Python | Python | py | Runtime Error | 0 | 0 | 982 | alpha = list('abcdefghijklmnopqrstuvwxyz') * 2
def create_caesar(word, num):
new_word = ""
if num < 0: num = 26 + num
for s in word:
new_word += alpha[alpha.index(s) + num]
return new_word
check_the = [create_caesar('the', i) for i in range(26)]
check_this = [create_caesar('this', i) for i in range(26)]
check_that = [create_caesar('that', i) for i in range(26)]
set_the = set(check_the)
set_this = set(check_this)
set_that = set(check_that)
while True:
sentence = raw_input().split()
sentence[-1] = sentence[-1].replace('.', '')
ans = []
set_sentence = set(sentence)
if len(set_sentence & set_the)!= 0:
num = check_the.index(list(set_sentence & set_the)[0])
tmp = check_the[num]
elif len(set_sentence & set_this)!= 0:
num = check_this.index(list(set_sentence & set_this)[0])
elif len(set_sentence & set_that)!= 0:
num = check_that.index(list(set_sentence & set_that)[0])
for s in sentence:
ans.append(create_caesar(s, -num))
print " ".join(ans) + "." |
s324792814 | p00017 | u193025715 | 1395390353 | Python | Python | py | Runtime Error | 0 | 0 | 982 | alpha = list('abcdefghijklmnopqrstuvwxyz') * 2
def create_caesar(word, num):
new_word = ""
if num < 0: num = 26 + num
for s in word:
new_word += alpha[alpha.index(s) + num]
return new_word
check_the = [create_caesar('the', i) for i in range(26)]
check_this = [create_caesar('this', i) for i in range(26)]
check_that = [create_caesar('that', i) for i in range(26)]
set_the = set(check_the)
set_this = set(check_this)
set_that = set(check_that)
while True:
sentence = raw_input().split()
sentence[-1] = sentence[-1].replace('.', '')
ans = []
set_sentence = set(sentence)
if len(set_sentence & set_the)!= 0:
num = check_the.index(list(set_sentence & set_the)[0])
tmp = check_the[num]
elif len(set_sentence & set_this)!= 0:
num = check_this.index(list(set_sentence & set_this)[0])
elif len(set_sentence & set_that)!= 0:
num = check_that.index(list(set_sentence & set_that)[0])
for s in sentence:
ans.append(create_caesar(s, -num))
print " ".join(ans) + "." |
s000114250 | p00017 | u023846178 | 1395815869 | Python | Python | py | Runtime Error | 0 | 0 | 319 | import string, sys
rot1 = string.maketrans("abcdefghijklmnopqrstuvwxyz. ",\
"bcdefghijklmnopqrstuvwxyza. ")
for line in sys.stdin
while 1:
if line.count("the") or line.count("this") or line.count("that"):
print line
break
line = text.translate(rot1) |
s987727695 | p00017 | u023846178 | 1395816087 | Python | Python | py | Runtime Error | 0 | 0 | 319 | import sys,string
rot1 = string.maketrans("abcdefghijklmnopqrstuvwxyz. ",\
"bcdefghijklmnopqrstuvwxyza. ")
for line in sys.stdin:
while 1:
if line.count("the") or line.count("this") or line.count("that"):
print line
break
line = text.translate(rot1) |
s890989397 | p00017 | u350508326 | 1397413096 | Python | Python | py | Runtime Error | 0 | 0 | 1281 | def main():
check_words = ('the', 'this', 'that')
caesar_chipher_text = tuple(map(str, input().split()))
if __debug__:
print(caesar_chipher_text)
for i in range(26):
after_text = []
flag = False
if __debug__:
print('['+ str(i) + ']', end='')
print('--------------for word in caesar_chipher_text: ---------------')
for word in caesar_chipher_text:
if __debug__:
print(i)
print('word: ' + word)
after_word = []
for char in word:
if __debug__:
print(ord(char))
char = slide_char(char, i)
after_word.append(char)
after_text.append(after_word)
if ''.join(after_word) in check_words:
if __debug__:
print('yes')
flag = True
if __debug__:
print(after_word)
if __debug__:
print('dubug:', end='')
print(after_text)
if flag:
anser = []
for text in after_text:
anser.append(''.join(text))
print(' '.join(anser))
break
if __name__ == '__main__':
main() |
s441028988 | p00017 | u350508326 | 1397413169 | Python | Python | py | Runtime Error | 0 | 0 | 1161 |
def slide_char(char, num):
if char == '.':
return char
if ord('A') <= ord(char) <= ord('Z'):
if (ord(char) + num) <= ord('Z'):
return chr(ord(char) + num)
else:
return chr(ord('A') + ord(char) + num - ord('Z') - 1)
else:
if (ord(char) + num) <= ord('z'):
return chr(ord(char) + num)
else:
return chr(ord('a') + ord(char) + num - ord('z') - 1)
def main():
check_words = ('the', 'this', 'that')
caesar_chipher_text = tuple(map(str, input().split()))
for i in range(26):
after_text = []
flag = False
for word in caesar_chipher_text:
after_word = []
for char in word:
char = slide_char(char, i)
after_word.append(char)
after_text.append(after_word)
if ''.join(after_word) in check_words:
flag = True
if flag:
anser = []
for text in after_text:
anser.append(''.join(text))
print(' '.join(anser))
break
if __name__ == '__main__':
main() |
s177158952 | p00017 | u350508326 | 1397413270 | Python | Python | py | Runtime Error | 0 | 0 | 1165 |
def slide_char(char, num):
if char == '.':
return char
if ord('A') <= ord(char) <= ord('Z'):
if (ord(char) + num) <= ord('Z'):
return chr(ord(char) + num)
else:
return chr(ord('A') + ord(char) + num - ord('Z') - 1)
else:
if (ord(char) + num) <= ord('z'):
return chr(ord(char) + num)
else:
return chr(ord('a') + ord(char) + num - ord('z') - 1)
def main():
check_words = ('the', 'this', 'that')
caesar_chipher_text = tuple(map(str,raw_ input().split()))
for i in range(26):
after_text = []
flag = False
for word in caesar_chipher_text:
after_word = []
for char in word:
char = slide_char(char, i)
after_word.append(char)
after_text.append(after_word)
if ''.join(after_word) in check_words:
flag = True
if flag:
anser = []
for text in after_text:
anser.append(''.join(text))
print(' '.join(anser))
break
if __name__ == '__main__':
main() |
s610786558 | p00018 | u525366883 | 1535540889 | Python | Python | py | Runtime Error | 0 | 0 | 79 | n = map(int, raw_input().split())
n.sort(revers=True)
for i in n:
print i,
|
s966415834 | p00018 | u537067968 | 1551622014 | Python | Python3 | py | Runtime Error | 0 | 0 | 145 | while True:
a = list(map(int, (input().split())))
a = sorted(a, reverse=True)
for i in range(4): print(a[i],end=' ')
print(a[4])
|
s604514956 | p00018 | u744114948 | 1425902184 | Python | Python | py | Runtime Error | 0 | 0 | 143 | s=list(map(int, input().split()))
s.sort()
s.reverse()
for i in s:
print(i, end="")
if i != s[-1]:
print(" ", end="")
print() |
s430771345 | p00018 | u873482706 | 1434514967 | Python | Python | py | Runtime Error | 0 | 0 | 142 | import sys
for input_line in sys.stdin:
input_line = raw_input().split()
input_line.sort(reverse=True)
print ' '.join(input_line) |
s240986079 | p00018 | u994049982 | 1458673423 | Python | Python | py | Runtime Error | 0 | 0 | 73 | a=sorted(map(int,input().split()))[::-1]
print("%d %d %d %d %d"%tuple(a)) |
s192916890 | p00018 | u994049982 | 1458673530 | Python | Python | py | Runtime Error | 0 | 0 | 78 | a=map(int,input().split())
a.sort()
a=a[::-1]
print("%d %d %d %d %d"%tuple(a)) |
s811998685 | p00018 | u894114233 | 1461815723 | Python | Python | py | Runtime Error | 0 | 0 | 70 | n=map(str,raw_imput().split())
n.sort()
n.reverse()
print(' '.join(n)) |
s214322309 | p00018 | u894114233 | 1461815771 | Python | Python | py | Runtime Error | 0 | 0 | 70 | n=map(str,raw_imput().split())
n.sort()
n.reverse()
print(' '.join(n)) |
s912171315 | p00018 | u894114233 | 1461815890 | Python | Python | py | Runtime Error | 0 | 0 | 111 | n=map(int,raw_imput().split())
ans=[]
n.sort()
n.reverse()
for i in n:
ans.append(str(i))
print(' '.join(ans)) |
s733073956 | p00018 | u744114948 | 1465016594 | Python | Python3 | py | Runtime Error | 0 | 0 | 83 | l = list(map(int, input().split))
l.sort()
l.reverse()
print(" ".join(map(str, l))) |
s187808381 | p00018 | u744114948 | 1465016626 | Python | Python3 | py | Runtime Error | 0 | 0 | 97 | l = list(map(int, input().split))
l.sort()
l.reverse()
sl = list(map(str, l))
print(" ".join(sl)) |
s640993559 | p00018 | u744114948 | 1465016641 | Python | Python3 | py | Runtime Error | 0 | 0 | 33 | l = list(map(int, input().split)) |
s738794311 | p00018 | u898097781 | 1467376878 | Python | Python | py | Runtime Error | 0 | 0 | 86 | data = raw_input().split(' ')
data = sorted(map(int, data))[::-1]
print ' '.join(data) |
s606484759 | p00018 | u300946041 | 1468675671 | Python | Python3 | py | Runtime Error | 0 | 0 | 81 | # -*- coding: utf-8 -*-
print(' '.join(sorted([input().split()], reverse=True))) |
s882941527 | p00018 | u922871577 | 1479285571 | Python | Python | py | Runtime Error | 0 | 0 | 70 | print ' '.join(map(str, sorted(map(int, raw_input().split()))[::-1]))) |
s719781772 | p00018 | u661290476 | 1482220673 | Python | Python3 | py | Runtime Error | 0 | 0 | 75 | a=sorted([int(i) for i in input().split()],reverse=True)
print(",".join(a)) |
s242244710 | p00018 | u661290476 | 1484814905 | Python | Python3 | py | Runtime Error | 0 | 0 | 74 | print(" ".join(sorted([int(i) for i in input().split()], reverse = True))) |
s371735785 | p00018 | u546285759 | 1516409073 | Python | Python3 | py | Runtime Error | 0 | 0 | 48 | print(*sorted(map(int, input().spilt()))[::-1])
|
s177926464 | p00018 | u150984829 | 1516956801 | Python | Python3 | py | Runtime Error | 0 | 0 | 43 | print(*reversed(map(int,input().split())))
|
s721529353 | p00018 | u017525488 | 1350120148 | Python | Python | py | Runtime Error | 0 | 0 | 101 | import sys
a = map(int, sys.stdin.readline().strip().split())
a.sort()
a.reverse()
print " ".join(a) |
s016721112 | p00018 | u560838141 | 1357484497 | Python | Python | py | Runtime Error | 0 | 0 | 89 | " ".join(map(str, sorted(map(int, raw_input().strip().sprit(" ")), lambda x , y: y - x))) |
s874688006 | p00018 | u560838141 | 1357484520 | Python | Python | py | Runtime Error | 0 | 0 | 95 | print " ".join(map(str, sorted(map(int, raw_input().strip().sprit(" ")), lambda x , y: y - x))) |
s203746699 | p00018 | u560838141 | 1358651536 | Python | Python | py | Runtime Error | 0 | 0 | 92 | l = map(int, raw_input().strip().split(" "));
print " ".join(sorted(l, lambda x, y: y - x)); |
s665291406 | p00018 | u743065194 | 1363923100 | Python | Python | py | Runtime Error | 0 | 0 | 140 | '''
Created on Mar 22, 2013
@author: wukc
'''
from sys import stdin
a=map(int,stdin.readline().split())
a.sort()
print(" ".join(a[::-1])) |
s592394521 | p00018 | u523886269 | 1381369101 | Python | Python | py | Runtime Error | 0 | 0 | 122 | #!/usr/bin/python
line = raw_input()
l = map(int, line.strip().split())
l.sort()
l.reverse()
out = ' '.join(l)
print out |
s212785537 | p00018 | u912237403 | 1389474354 | Python | Python | py | Runtime Error | 0 | 0 | 67 | for e in sorted(map(int,input().split()))[::-1]:
print e,
print |
s960017297 | p00018 | u230836528 | 1392306641 | Python | Python | py | Runtime Error | 0 | 0 | 319 |
import sys
lineNumber = 0
#for line in [ "xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt." ]:
for line in sys.stdin.readlines():
lineNumber += 1
# get data
List = map(int, line.strip().split(","))
List = List.sort().reverse()
print "%d %d %d %d %d" % (List[0], List[1], List[2], List[3], List[4]) |
s664875570 | p00018 | u230836528 | 1392306663 | Python | Python | py | Runtime Error | 0 | 0 | 316 |
import sys
lineNumber = 0
#for line in [ "xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt." ]:
for line in sys.stdin.readlines():
lineNumber += 1
# get data
List = map(int, line.strip().split())
List = List.sort().reverse()
print "%d %d %d %d %d" % (List[0], List[1], List[2], List[3], List[4]) |
s250283134 | p00018 | u436634575 | 1401140979 | Python | Python3 | py | Runtime Error | 0 | 0 | 52 | print(' '.join(map(str, sorted(map(int, input()))))) |
s739622137 | p00019 | u014849532 | 1420211633 | Python | Python3 | py | Runtime Error | 0 | 0 | 59 | def f(x):return 1if x<2else x*f(x-1)
print(f(int(input()))) |
s329864511 | p00019 | u744114948 | 1425902520 | Python | Python3 | py | Runtime Error | 0 | 0 | 65 | s=int(input())
ans=1
for i in range(1,s+1)
ans*=i
print(ans) |
s445304830 | p00019 | u976860528 | 1431700204 | Python | Python3 | py | Runtime Error | 0 | 0 | 71 | x=input()
def f(n):
if n==0:return 1
return f(n-1)*n
print(f(int(n))) |
s044394888 | p00019 | u976860528 | 1431700240 | Python | Python3 | py | Runtime Error | 0 | 0 | 98 | # -*- coding:shift-jis -*-
x=input()
def f(n):
if n==0:return 1
return f(n-1)*n
print(f(int(n))) |
s143973247 | p00019 | u140201022 | 1444539199 | Python | Python | py | Runtime Error | 0 | 0 | 63 | ans=1
for i in range(1,int(raw_input()+1):
ans*=i
print ans |
s980644448 | p00019 | u075836834 | 1458511343 | Python | Python3 | py | Runtime Error | 0 | 0 | 59 | from math import factorical
print(factorical(int(input()))) |
s836796537 | p00019 | u075836834 | 1458511354 | Python | Python3 | py | Runtime Error | 0 | 0 | 58 | from math import factorical
print(factorical(int(input())) |
s102658708 | p00019 | u075836834 | 1458511367 | Python | Python3 | py | Runtime Error | 0 | 0 | 58 | from math import factorical
print(factorical(int(input())) |
s541255645 | p00019 | u075836834 | 1458511382 | Python | Python3 | py | Runtime Error | 0 | 0 | 56 | from math import factorial
print(factorial(int(input())) |
s740882874 | p00019 | u618637847 | 1494900465 | Python | Python3 | py | Runtime Error | 0 | 0 | 57 |
import math
num = int(input)
print(math.factorial(num)) |
s084905249 | p00019 | u519227872 | 1496496457 | Python | Python3 | py | Runtime Error | 0 | 0 | 62 | from math import factorial
n = int(input())
print factorial(n) |
s542647178 | p00019 | u928329738 | 1511742302 | Python | Python3 | py | Runtime Error | 0 | 0 | 123 | def factorial(n):
if n == 1:
return 1
else:
return n * factorial(n-1)
n=input()
print(factorial(n)) |
s523404453 | p00019 | u282635979 | 1363436594 | Python | Python | py | Runtime Error | 0 | 0 | 68 | n = input()
answer = 1
while != 1:
answer *= n
n -= 1
print answer |
s704831568 | p00019 | u743065194 | 1363923436 | Python | Python | py | Runtime Error | 0 | 0 | 149 | '''
Created on Mar 22, 2013
@author: wukc
'''
from numpy import product
from sys import stdin
n=int(stdin.readline())
print(product(range(1,n+1))) |
s433425833 | p00020 | u452212317 | 1436154074 | Python | Python | py | Runtime Error | 0 | 0 | 27 | x = input().upper()
print x |
s312540988 | p00020 | u922871577 | 1479285723 | Python | Python | py | Runtime Error | 0 | 0 | 28 | print raw_input().to_upper() |
s214284883 | p00020 | u280179677 | 1356071047 | Python | Python | py | Runtime Error | 0 | 0 | 189 | #!/usr/bin/python
def datasets():
s = raw_input().strip()
yield s
def main():
for s in datasets():
import s.lower()
if __name__ == '__main__':
main() |
s597650235 | p00021 | u525366883 | 1535543233 | Python | Python | py | Runtime Error | 0 | 0 | 232 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
a = (x2 - x1) / (y2 - y1)
b = (x4 - x3) / (y4 - y3)
if a == b:
print"YES"
else:
print "NO"
|
s616760234 | p00021 | u525366883 | 1535543668 | Python | Python | py | Runtime Error | 0 | 0 | 326 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (x2-x1) == 0 or (x4-x3) == 0:
print "YES
else:
a = (x2 - x1) / (y2 - y1)
b = (x4 - x3) / (y4 - y3)
if a == b:
print"YES"
else:
print "NO"
|
s750336602 | p00021 | u525366883 | 1535543776 | Python | Python | py | Runtime Error | 0 | 0 | 410 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (x2-x1) == 0 or (x4-x3) == 0:
if (x2-x1) == 0 and (x4-x3) == 0:
print "YES"
else:
print "NO"
else:
a = (x2 - x1) / (y2 - y1)
b = (x4 - x3) / (y4 - y3)
if a == b:
print"YES"
else:
print "NO"
|
s185378937 | p00021 | u525366883 | 1535543831 | Python | Python | py | Runtime Error | 0 | 0 | 410 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (x2-x1) == 0 or (x4-x3) == 0:
if (x2-x1) == 0 and (x4-x3) == 0:
print "YES"
else:
print "NO"
else:
a = (x2 - x1) / (y2 - y1)
b = (x4 - x3) / (y4 - y3)
if a == b:
print"YES"
else:
print "NO"
|
s900707075 | p00021 | u525366883 | 1535544026 | Python | Python | py | Runtime Error | 0 | 0 | 382 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (x2-x1) == 0 or (x4-x3) == 0:
if (x2-x1) == 0 and (x4-x3) == 0:
print "YES"
else:
print "NO"
else:
if (x2 - x1) / (y2 - y1) == (x4 - x3) / (y4 - y3):
print"YES"
else:
print "NO"
|
s866551161 | p00021 | u525366883 | 1535544197 | Python | Python | py | Runtime Error | 0 | 0 | 382 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (x1-x2) == 0 or (x3-x4) == 0:
if (x1-x2) == 0 and (x3-x4) == 0:
print "YES"
else:
print "NO"
else:
if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4):
print"YES"
else:
print "NO"
|
s845082177 | p00021 | u525366883 | 1535544337 | Python | Python | py | Runtime Error | 0 | 0 | 382 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (x1-x2) == 0 or (x3-x4) == 0:
if (x1-x2) == 0 and (x3-x4) == 0:
print "YES"
else:
print "NO"
else:
if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4):
print"YES"
else:
print "NO"
|
s979535246 | p00021 | u525366883 | 1535544477 | Python | Python | py | Runtime Error | 0 | 0 | 382 | n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (x1-x2) == 0 or (x3-x4) == 0:
if (x1-x2) == 0 and (x3-x4) == 0:
print "YES"
else:
print "NO"
else:
if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4):
print"YES"
else:
print "NO"
|
s847619081 | p00021 | u525366883 | 1535545058 | Python | Python | py | Runtime Error | 0 | 0 | 370 | for i in int(raw_input())):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
if (y1-y2) == 0 or (y3-y4) == 0:
if (y1-y2) == 0 and (y3-y4) == 0:
print "YES"
else:
print "NO"
else:
if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4):
print"YES"
else:
print "NO"
|
s093975847 | p00021 | u199004585 | 1540552998 | Python | Python3 | py | Runtime Error | 0 | 0 | 712 | import sys
args = sys.argv
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
# input = [6, 6, 6, 15, 15, 15,20,3]
# A,B,C,D = (Point(input[i],input[i+1]) for i in range(0,len(input),2))
# tmp = B - A
# tmp2 = C - D
# tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
for _ in range(args[0]):
if not _ == 0:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
yield "YES"
else:
yield "NO"
|
s689633718 | p00021 | u199004585 | 1540553006 | Python | Python3 | py | Runtime Error | 0 | 0 | 712 | import sys
args = sys.argv
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
# input = [6, 6, 6, 15, 15, 15,20,3]
# A,B,C,D = (Point(input[i],input[i+1]) for i in range(0,len(input),2))
# tmp = B - A
# tmp2 = C - D
# tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
for _ in range(args[0]):
if not _ == 0:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
yield "YES"
else:
yield "NO"
|
s291930552 | p00021 | u199004585 | 1540553350 | Python | Python3 | py | Runtime Error | 0 | 0 | 546 | import sys
args = sys.argv
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
yield "YES"
else:
yield "NO"
|
s256047174 | p00021 | u199004585 | 1540553397 | Python | Python3 | py | Runtime Error | 0 | 0 | 734 | import sys
args = sys.argv
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
# input = [6, 6, 6, 15, 15, 15,20,3]
# A,B,C,D = (Point(input[i],input[i+1]) for i in range(0,len(input),2))
# tmp = B - A
# tmp2 = C - D
# tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
print("YES")
else:
print("NO")
|
s213835812 | p00021 | u199004585 | 1540553458 | Python | Python3 | py | Runtime Error | 0 | 0 | 734 | import sys
args = sys.argv
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
# input = [6, 6, 6, 15, 15, 15,20,3]
# A,B,C,D = (Point(input[i],input[i+1]) for i in range(0,len(input),2))
# tmp = B - A
# tmp2 = C - D
# tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
print("YES")
else:
print("NO")
|
s705799538 | p00021 | u199004585 | 1540553463 | Python | Python3 | py | Runtime Error | 0 | 0 | 562 | import sys
args = sys.argv
print(args)
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
print("YES")
else:
print("NO")
|
s766836607 | p00021 | u199004585 | 1540553510 | Python | Python3 | py | Runtime Error | 0 | 0 | 580 | import sys
args = sys.argv
args = [int(a) for a in args]
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
print("YES")
else:
print("NO")
|
s826145572 | p00021 | u199004585 | 1540553599 | Python | Python3 | py | Runtime Error | 0 | 0 | 587 | import sys
args = sys.argv
args = [int(float(a)) for a in args]
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if tmp3 == 0:
print("YES")
else:
print("NO")
|
s467393622 | p00021 | u199004585 | 1540554035 | Python | Python3 | py | Runtime Error | 0 | 0 | 602 | import sys
# args = sys.argv
args = [int(float(a)) for line in sys.stdin]
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if int(tmp3) == 0:
print("YES")
else:
print("NO")
|
s426830196 | p00021 | u199004585 | 1540555060 | Python | Python3 | py | Runtime Error | 0 | 0 | 602 | import sys
# args = sys.argv
args = [int(float(a)) for line in sys.stdin]
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if int(tmp3) == 0:
print("YES")
else:
print("NO")
|
s349704664 | p00021 | u199004585 | 1540555084 | Python | Python3 | py | Runtime Error | 0 | 0 | 602 | import sys
# args = sys.argv
args = [int(float(a)) for line in sys.stdin]
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if int(tmp3) == 0:
print("YES")
else:
print("NO")
|
s934238781 | p00021 | u199004585 | 1540555118 | Python | Python3 | py | Runtime Error | 0 | 0 | 602 | import sys
# args = sys.argv
args = [int(float(a)) for line in sys.stdin]
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if int(tmp3) == 0:
print("YES")
else:
print("NO")
|
s872872905 | p00021 | u199004585 | 1540555148 | Python | Python3 | py | Runtime Error | 0 | 0 | 605 | import sys
# args = sys.argv
args = [int(float(line)) for line in sys.stdin]
class Point():
def __init__(self,x,y):
self.x = x
self.y = y
def __sub__(self,oth):
self.x = self.x - oth.x
self.y = self.y - oth.y
return Point(self.x,self.y)
def __str__(self):
return "%s(%r)" %(self.__class__,self.__dict__)
for _ in range(args[0]):
if _ == 0:
pass
else:
A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
tmp = B - A
tmp2 = C - D
tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
if int(tmp3) == 0:
print("YES")
else:
print("NO")
|
s972601215 | p00021 | u990228206 | 1551339250 | Python | Python3 | py | Runtime Error | 0 | 0 | 261 | n=int(input())
for nn in range(n):
x1,y1,x2,y2,x3,y3,x4,y4=list(map(float,input().split()))
if x1==x2 and x3==x4:
print("YES")
else:
if (y2-y1)/(x2-x1)==(y4-y3)/(x4-x3):
print("YES")
else:
print("NO")
|
s339987650 | p00021 | u198069342 | 1407222667 | Python | Python | py | Runtime Error | 0 | 0 | 185 | n = int(input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
print('YES' if abs((x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1)) < 1e-10 else 'NO') |
s269775400 | p00021 | u385497113 | 1409334483 | Python | Python | py | Runtime Error | 0 | 0 | 442 | #! -*- coding: utf-8-unix -*-
import sys
if __name__=='__main__':
lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
n = int(lines[0])
for i in xrange(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
a1 = (y2 - y1) / (x2 - x1)
b1 = y1 - a1 * x1
a2 = (y4 - y3) / (x4 - x3)
b2 = y3 - a2 * x3
if (a1 == a2) and (b1 != b2):
print 'YES'
else:
print 'NO' |
s188721370 | p00021 | u385497113 | 1409334816 | Python | Python | py | Runtime Error | 0 | 0 | 618 | #! -*- coding: utf-8-unix -*-
import sys
if __name__=='__main__':
lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
n = int(lines[0])
for i in xrange(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
if x1 == x2:
if x3 == x4:
print 'YES'
else:
print 'NO'
elif y1 == y2:
if y3 == y4:
print 'YES'
else:
print 'NO'
a1 = (y2 - y1) / (x2 - x1)
b1 = y1 - a1 * x1
a2 = (y4 - y3) / (x4 - x3)
b2 = y3 - a2 * x3
if (a1 == a2) and (b1 != b2):
print 'YES'
else:
print 'NO' |
s741301834 | p00021 | u385497113 | 1409334885 | Python | Python | py | Runtime Error | 0 | 0 | 616 | #! -*- coding: utf-8-unix -*-
import sys
if __name__=='__main__':
lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
n = int(lines[0])
for i in xrange(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
if x1 == x2:
if x3 == x4:
print 'YES'
else:
print 'NO'
if y1 == y2:
if y3 == y4:
print 'YES'
else:
print 'NO'
a1 = (y2 - y1) / (x2 - x1)
b1 = y1 - a1 * x1
a2 = (y4 - y3) / (x4 - x3)
b2 = y3 - a2 * x3
if (a1 == a2) and (b1 != b2):
print 'YES'
else:
print 'NO' |
s191920752 | p00021 | u385497113 | 1409338197 | Python | Python | py | Runtime Error | 0 | 0 | 616 | #! -*- coding: utf-8-unix -*-
import sys
if __name__=='__main__':
lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
n = int(lines[0])
for i in xrange(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
if x1 == x2:
if x3 == x4:
print 'YES'
else:
print 'NO'
if y1 == y2:
if y3 == y4:
print 'YES'
else:
print 'NO'
a1 = (y2 - y1) / (x2 - x1)
b1 = y1 - a1 * x1
a2 = (y4 - y3) / (x4 - x3)
b2 = y3 - a2 * x3
if (a1 == a2) and (b1 != b2):
print 'YES'
else:
print 'NO' |
s488354480 | p00021 | u385497113 | 1409338313 | Python | Python | py | Runtime Error | 0 | 0 | 725 | #! -*- coding: utf-8-unix -*-
import sys
if __name__=='__main__':
# lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
# n = int(lines[0])
n = input()
for i in xrange(n):
# x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, sys.stdin.readline().strip().split(' '))
if x1 == x2:
if x3 == x4:
print 'YES'
else:
print 'NO'
if y1 == y2:
if y3 == y4:
print 'YES'
else:
print 'NO'
a1 = (y2 - y1) / (x2 - x1)
b1 = y1 - a1 * x1
a2 = (y4 - y3) / (x4 - x3)
b2 = y3 - a2 * x3
if (a1 == a2) and (b1 != b2):
print 'YES'
else:
print 'NO' |
s001726014 | p00021 | u385497113 | 1409338399 | Python | Python | py | Runtime Error | 0 | 0 | 725 | #! -*- coding: utf-8-unix -*-
import sys
if __name__=='__main__':
# lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
# n = int(lines[0])
n = int(raw_input())
for i in xrange(n):
# x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().strip().split(' '))
if x1 == x2:
if x3 == x4:
print 'YES'
else:
print 'NO'
if y1 == y2:
if y3 == y4:
print 'YES'
else:
print 'NO'
a1 = (y2 - y1) / (x2 - x1)
b1 = y1 - a1 * x1
a2 = (y4 - y3) / (x4 - x3)
b2 = y3 - a2 * x3
if (a1 == a2) and (b1 != b2):
print 'YES'
else:
print 'NO' |
s419175897 | p00021 | u385497113 | 1409338543 | Python | Python | py | Runtime Error | 0 | 0 | 775 | #! -*- coding: utf-8-unix -*-
import sys
if __name__=='__main__':
# lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
# n = int(lines[0])
n = int(raw_input())
for i in xrange(n):
# x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().strip().split(' '))
if x1 == x2 or x3 == x4:
if x1 == x2 and x3 == x4:
print 'YES'
else:
print 'NO'
if y1 == y2 or y3 == y4:
if y1 == y2 and y3 == y4:
print 'YES'
else:
print 'NO'
a1 = (y2 - y1) / (x2 - x1)
b1 = y1 - a1 * x1
a2 = (y4 - y3) / (x4 - x3)
b2 = y3 - a2 * x3
if (a1 == a2) and (b1 != b2):
print 'YES'
else:
print 'NO' |
s640461430 | p00021 | u615353970 | 1411038127 | Python | Python | py | Runtime Error | 0 | 0 | 172 | n = int(raw_input())
for l in range(n):
x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
if (x1-x2)/(y1-y2) == (x3-x4)/(y3-y4):
print 'YES'
else:
print 'NO' |
s506222089 | p00021 | u615353970 | 1411038480 | Python | Python | py | Runtime Error | 0 | 0 | 336 | n = int(raw_input())
for l in range(n):
x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
if x1 - x2 == 0 and x3 - x4 == 0 :
print 'YES'
elif x1 - x2 != 0 and x3 - x4 == 0 :
print 'NO'
elif x1 - x2 == 0 and x3 - x4 != 0 :
print 'NO'
else:
if (x1-x2)/(y1-y2) == (x3-x4)/(y3-y4):
print 'YES'
else:
print 'NO' |
s157400132 | p00021 | u696166817 | 1416057642 | Python | Python3 | py | Runtime Error | 0 | 0 | 474 | # Edit: 2014/11/15
# Lang: Python3
# Time: 00.xxs
# File: pc0021.py
if __name__ == "__main__":
nset = int(input())
for i in range(0, nset):
x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().strip("\n").split(" ")))
vABx = x2 - x1
vABy = y2 - y1
vCDx = x4 - x3
vCDy = y4 - y3
mx = vCDx / vABx
my = vCDy / vABy
if mx == my:
print("YES")
else:
print("NO")
# |
s852123499 | p00021 | u696166817 | 1416058140 | Python | Python3 | py | Runtime Error | 0 | 0 | 508 | # Edit: 2014/11/15
# Lang: Python3
# Time: 00.xxs
# File: pc0021.py
if __name__ == "__main__":
nset = int(input())
for i in range(0, nset):
x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().strip("\n").split(" ")))
vABx = x2 - x1
vABy = y2 - y1
vCDx = x4 - x3
vCDy = y4 - y3
mx = vCDx / vABx
my = vCDy / vABy
if abs(mx - my) < 1e-10:
print("YES")
else:
print("NO")
#print(mx-my)
# |
s640367020 | p00021 | u506132575 | 1416127914 | Python | Python | py | Runtime Error | 0 | 0 | 358 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
num = input()
for s in sys.stdin:
d = map(float,s.split())
x1,y1,x2,y2,x3,y3,x4,y4 = d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7]
ab = [ x2-x1, y2-y1 ]
cd = [ x4-x3, y4-y3 ]
if ab[0] == 0 and cd[0] == 0:
print "YES"
elif ab[1]/ab[0] == cd[1]/cd[0]:
print "YES"
else:
print "NO" |
s275789144 | p00021 | u506132575 | 1416128007 | Python | Python | py | Runtime Error | 0 | 0 | 378 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
num = input()
for i in range(num):
d = map(float,sys.stdin.readline().split())
x1,y1,x2,y2,x3,y3,x4,y4 = d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7]
ab = [ x2-x1, y2-y1 ]
cd = [ x4-x3, y4-y3 ]
if ab[0] == 0 and cd[0] == 0:
print "YES"
elif ab[1]/ab[0] == cd[1]/cd[0]:
print "YES"
else:
print "NO" |
s359274279 | p00021 | u607831289 | 1416146567 | Python | Python | py | Runtime Error | 0 | 0 | 383 | n = int(raw_input())
for i in range(n):
points = map(float, raw_input().split())
x1, y1 = points[0], points[1]
x2, y2 = points[2], points[3]
x3, y3 = points[4], points[5]
x4, y4 = points[6], points[7]
gradientAB = (y2 - y1) / (x2 - x1)
gradientCD = (y4 - y3) / (x4 - x3)
if gradientAB == gradientCD:
print 'YES'
else:
print 'NO' |
s854146018 | p00021 | u607831289 | 1416146689 | Python | Python | py | Runtime Error | 0 | 0 | 399 | n = int(raw_input())
for i in range(n):
line = raw_input()
points = map(float, line.split())
x1, y1 = points[0], points[1]
x2, y2 = points[2], points[3]
x3, y3 = points[4], points[5]
x4, y4 = points[6], points[7]
gradientAB = (y2 - y1) / (x2 - x1)
gradientCD = (y4 - y3) / (x4 - x3)
if gradientAB == gradientCD:
print 'YES'
else:
print 'NO' |
s424379440 | p00021 | u607831289 | 1416146857 | Python | Python | py | Runtime Error | 0 | 0 | 400 | import sys
lines = sys.stdin.readlines()
for line in lines[1:]:
points = map(float, line.split())
x1, y1 = points[0], points[1]
x2, y2 = points[2], points[3]
x3, y3 = points[4], points[5]
x4, y4 = points[6], points[7]
gradientAB = (y2 - y1) / (x2 - x1)
gradientCD = (y4 - y3) / (x4 - x3)
if gradientAB == gradientCD:
print 'YES'
else:
print 'NO' |
s722610537 | p00021 | u607831289 | 1416147935 | Python | Python | py | Runtime Error | 0 | 0 | 557 | import sys
lines = sys.stdin.readlines()
for line in lines[1:]:
points = map(float, line.split())
print points
x1, y1 = points[0], points[1]
x2, y2 = points[2], points[3]
x3, y3 = points[4], points[5]
x4, y4 = points[6], points[7]
if x2 - x1 == x4 - x3 == 0:
print 'YES'
elif y2 - y1 == y4 - y3 == 0:
print 'YES'
else:
gradientAB = (y2 - y1) / (x2 - x1)
gradientCD = (y4 - y3) / (x4 - x3)
if gradientAB == gradientCD:
print 'YES'
else:
print 'NO' |
s894647449 | p00021 | u567380442 | 1422791837 | Python | Python3 | py | Runtime Error | 0 | 0 | 479 | import sys
f = sys.stdin
def take2(iterable):
i = iter(iterable)
while True:
yield next(i) + next(i) * 1j
n = int(f.readline())
for _ in range(n):
xy = [xiyi for xiyi in take2(map(float, f.readline().split()))]
a, b, c, d = xy
temp = (a - b) / (c - d)
if abs(temp.imag) < 0.001:
temp = (a - b) / (a - c)
if abs(temp.imag) < 0.001:
print('NO')
else:
print('YES')
else:
print('NO') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.