submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s417281902
p00003
Runtime Error
times=int(input()) answers=[] for i in range(times): hen=[] hen=input().split() for j in range(times): hen[j]=int(hen[j]) for j in range(times-1): for k in range(times-1): if hen[j]>hen[j+1]: num=hen[j] hen[j]=hen[j+1] hen[j+1]=num if hen[0]*hen[0]+hen[1]*hen[1]==hen[2]*hen[2]: answers.append('Yes') else: answers.append('No') for i in range(len(answers)): print(answers[i])
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s111728416
p00003
Runtime Error
inputs = map(int, raw_input().split()) max = max(inputs) inputs.remove(max) if max ** 2 == inputs[0] **2 + inputs[1] **2 : print "Yes" else: print "No"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s848976849
p00003
Runtime Error
N = input() for i in range(N): l = [] line = raw_input() l.append(int(line.split()[0])) l.append(int(line.split()[1])) l.append(int(line.split()[2])) l.sort() if l[0]*l[0]+l[1]*l[1]==l[2]*l[2]: print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s591908441
p00003
Runtime Error
N = int(input()) for i in range(N): l = [] line = raw_input() l.append(int(line.split()[0])) l.append(int(line.split()[1])) l.append(int(line.split()[2])) l.sort() if l[0]*l[0]+l[1]*l[1]==l[2]*l[2]: print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s809573651
p00003
Runtime Error
N = int(input()) for i in range(N): l = [] line = raw_input() l.append(int(line.split()[0])) l.append(int(line.split()[1])) l.append(int(line.split()[2])) l.sort() if l[0]**2+l[1]**2==l[2]**2: print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s182769428
p00003
Runtime Error
N = int(input()) for i in range(N): line = raw_input() l = [None]*3 l[0] = int(line.split()[0]) l[1] = int(line.split()[1]) l[2] = int(line.split()[2]) l.sort() if l[0]**2+l[1]**2==l[2]**2: print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s068524612
p00003
Runtime Error
def tri(a,b,c): return a^2 == b^2 + c^2 for time in range(int(input())): x,y,z = [int(i) for i in input().split()] if tri(x,y,z) or tri(y,z,x) or tri(z,x,y): print(???YES???) else: print(???NO???)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s525418391
p00003
Runtime Error
def tri(a,b,c): return a^2 == b^2 + c^2 for time in range(int(input())): x,y,z = [int(i) for i in input().split()] if tri(x,y,z): print(???YES???) else: print(???NO???)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s505441087
p00003
Runtime Error
def tri(a,b,c): if a^2 == b^2 + c^2: return true else: return false for time in range(int(input())): x,y,z = [int(i) for i in input().split()] if tri(x,y,z) or tri(y,z,x) or tri(z,x,y): print(???YES???) else: print(???NO???)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s899542873
p00003
Runtime Error
for time in range(int(input())): x,y,z = [int(i) for i in input().split()] if x^2 + y^2 == z^2: print(???YES???) else: print(???NO???)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s153859449
p00003
Runtime Error
def tri(a,b,c): return a**2 == b**2 + c**2 for time in range(int(input())): x,y,z = [int(i) for i in input().split()] if tri(x,y,z) or tri(y,z,x) or tri(z,x,y): print(???YES???)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s139904810
p00003
Runtime Error
# usr/bin/python # coding: utf-8 ################################################################################ # Is it a Right Triangle? # Write a program which judges wheather given length of three side form a right triangle. Print "YES" if the given sides (integers) form a right triangle, "NO" if not so. # # Input # Input consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. # # Constraints # 1 ??? length of the side ??? 1,000 # N ??? 1,000 # Output # For each data set, print "YES" or "NO". # # Sample Input # 3 # 4 3 5 # 4 3 6 # 8 8 8 # Output for the Sample Input # YES # NO # NO # ################################################################################ import math import fileinput if __name__ == "__main__": for line in fileinput.input(): a = int(line.split(" ")[0]) b = int(line.split(" ")[1]) c = int(line.split(" ")[2]) if (a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a) : print("YES") else : print("NO") exit(0)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s991096043
p00003
Runtime Error
# usr/bin/python # coding: utf-8 ################################################################################ # Is it a Right Triangle? # Write a program which judges wheather given length of three side form a right triangle. Print "YES" if the given sides (integers) form a right triangle, "NO" if not so. # # Input # Input consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. # # Constraints # 1 ??? length of the side ??? 1,000 # N ??? 1,000 # Output # For each data set, print "YES" or "NO". # # Sample Input # 3 # 4 3 5 # 4 3 6 # 8 8 8 # Output for the Sample Input # YES # NO # NO # ################################################################################ import fileinput if __name__ == "__main__": for line in fileinput.input(): a = int(line.split(" ")[0]) b = int(line.split(" ")[1]) c = int(line.split(" ")[2]) if (a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a) : print("YES") else : print("NO") exit(0)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s421514698
p00003
Runtime Error
# usr/bin/python # coding: utf-8 ################################################################################ # Is it a Right Triangle? # Write a program which judges wheather given length of three side form a right triangle. # Print "YES" if the given sides (integers) form a right triangle, "NO" if not so. # # Input # Input consists of several data sets. In the first line, the number of data set, # N is given. Then, N lines follow, each line corresponds to a data set. # A data set consists of three integers separated by a single space. # # Constraints # 1 ??? length of the side ??? 1,000 # N ??? 1,000 # Output # For each data set, print "YES" or "NO". # # Sample Input # 3 # 4 3 5 # 4 3 6 # 8 8 8 # Output for the Sample Input # YES # NO # NO # ################################################################################ if __name__ == "__main__": line = input() a = int(line.split(" ")[0]) b = int(line.split(" ")[1]) c = int(line.split(" ")[2]) if (a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a) : print("YES") else : print("NO") exit(0)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s475418009
p00003
Runtime Error
if __name__ == "__main__": line = input() a = int(line.split(" ")[0]) b = int(line.split(" ")[1]) c = int(line.split(" ")[2]) if (a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a) : print("YES") else : print("NO") exit(0)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s657220650
p00003
Runtime Error
if __name__ == "__main__": line = input() a = int(line.split(" ")[0]) b = int(line.split(" ")[1]) c = int(line.split(" ")[2]) if (a*a+b*b==c*c) : print("YES") else : print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s326193588
p00003
Runtime Error
if __name__ == "__main__": line = input() a = int(line.split(" ")[0]) b = int(line.split(" ")[1]) c = int(line.split(" ")[2]) if (a*a+b*b==c*c): print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s302999210
p00003
Runtime Error
if __name__ == "__main__": line = input() a = int(line.split(" ")[0]) b = int(line.split(" ")[1]) c = int(line.split(" ")[2]) if (a*a+b*b == c*c): print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s857595348
p00003
Runtime Error
n = int(input()) for i in range(n): l = list(map(int, line.split())) l.sort() if l[0]**2 + l[1]**2 == l[3]**2: print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s436811705
p00003
Runtime Error
ans=[] n=raw_input() while True: line = raw_input() if not line: break a, b, c = (int(i) for i in line.split()) ans.append('YES' if c*c == a*a + b*b else 'NO' ) for i in ans: print i
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s401630708
p00003
Runtime Error
from sys import stdin ans=[] n=raw_input() for row in range(int(n)): line = stdin.readlines() a, b, c = (int(i) for i in line.split()) ans.append('YES' if c*c == a*a + b*b else 'NO' ) for i in ans: print i
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s274939541
p00003
Runtime Error
N=int(input()) while 1: a,b,c=map(int,input().split()) A=a**2 B=b**2 C=c**2 if A+B==C: print('YES') elif A+C==B: print('YES') elif B+C==A: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s983757329
p00003
Runtime Error
N=int(input()) while 1: a,b,c=map(int,input().split()) A=a**2 B=b**2 C=c**2 for i in len(N): if A+B==C: print('YES') elif A+C==B: print('YES') elif B+C==A: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s398056618
p00003
Runtime Error
while True: try: input_line = input() if input_line == '': break else: nums = list(map(int, input_line.split())) max_num = max(nums) nums.remove(max_num) if max_num**2 == nums[0]**2 + nums[1]**2: print("YES") else: print("NO") except EOFError: break
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s050799384
p00003
Runtime Error
import sys a = "" for input in sys.stdin: a += input l = a.split() for i in range(0,len(l),3): if((int(l[i]) * int(l[i]) + int(l[i+1]) * int(l[i+1])) == (int(l[i+2]) * int(l[i+2]))): print "YES" else: print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s283850575
p00003
Runtime Error
a, b, c = map(int, input().split()) if a**2 + b**2 == c**2: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s607294626
p00003
Runtime Error
a, b, c = sorted(map(int, input().split())) if a**2 + b**2 == c**2: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s793953262
p00003
Runtime Error
for e in sys.stdin: a, b, c = sorted(map(int, e.split())) if a**2 + b**2 == c**2: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s566177039
p00003
Runtime Error
import sys for e in sys.stdin: a, b, c = sorted(map(int, e.split())) if a**2 + b**2 == c**2: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s563907127
p00003
Runtime Error
import sys for e in int().input(): a, b, c = sorted(int(sys.stdin.split())) if a**2 + b**2 == c**2: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s173702518
p00003
Runtime Error
import sys input() for e in sys.stdin: a, b, c = sorted(int(e.split())) if a**2 + b**2 == c**2: print('YES') else: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s629073458
p00003
Runtime Error
import sys for a,b,c in map(lambda x:sorted(map(int,x.split())),sys.stdin): print(['NO','YES'][a*a+b*b==c*c])
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s567323953
p00003
Runtime Error
import sys for a,b,c in map(lambda x:sorted(map(int,x.split())),sys.stdin.readlines()): print(['NO','YES'][a*a+b*b==c*c])
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s559243429
p00003
Runtime Error
n = int(input()) for i in range(n): li = sorted(input().split()) if(li[0] ** 2 + li[1] ** 2 == li[3] ** 2): print('YES') elif: print('NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s845675213
p00003
Runtime Error
def main(): n = int(input()) for i in range(n): a, b, c=(int(input().split())) if a+b<=c or a+c<=b or b+c<=a: print("YES") else: print("NO") main()
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s342738888
p00003
Runtime Error
def main(): n = int(input()) n.sort() if n[0]**2+n[1]**2 != n[2]**2: print("NO") else: print("YES") main()
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s068817266
p00003
Runtime Error
[print(s) for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO', [sorted(int(x)**2 for x in input().split(' ') for i in range(int(input()))])]
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s389466734
p00003
Runtime Error
[print(s) for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO', [sorted(int(x)**2 for x in raw_input().split(' ') for i in range(int(raw_input()))])]
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s886464215
p00003
Runtime Error
[print(s) for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO', [sorted(int(x)**2 for x in raw_input().split(' ')) for i in range(int(raw_input()))])]
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s677394921
p00003
Runtime Error
a=[print(s) for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO', [sorted(int(x)**2 for x in raw_input().split(' ')) for i in range(int(raw_input()))])]
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s710072942
p00003
Runtime Error
a=[print(s) for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO',[sorted(int(x)**2 for x in input().split(' ')) for i in range(int(input()))])]
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s664019481
p00003
Runtime Error
x = int(input()) for a in range(x): y = map(int,raw_input(),split()) sort(y[3]) if y[2]**2-y[1]**2 == y[0]**2: print "YES" else: print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s276234060
p00003
Runtime Error
for i in range(int(raw_input())): n = [int(x) for x in raw_input().split()] n.sort(reverse=True) if n[0]**2 == n[1]**2 + n[2]**2: print "
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s799818960
p00003
Runtime Error
for i in range(int(raw_input())): &#160;&#160;&#160;&#160;sides = map(int, raw_input().split()) &#160;&#160;&#160;&#160;if sides[0]**2 == sides[1]**2 + sides[2]**2 or\ &#160;&#160;&#160;&#160;&#160;&#160;&#160;sides[1]**2 == sides[2]**2 + sides[0]**2 or\ &#160;&#160;&#160;&#160;&#160;&#160;&#160;sides[2]**2 == sides[0]**2 + sides[1]**2: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print "YES" &#160;&#160;&#160;&#160;else: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s178118819
p00003
Runtime Error
import sys for x in sys.stdin.readlines(): l = map(int,x.split()) l.sort() a,b,c = l if c**2 == a**2 + b**2 : print "YES" else: print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s613149746
p00003
Runtime Error
import sys for x in sys.stdin.readlines(): l = map(int,x.split()) l.sort() n,a,b,c = l if c**2 == a**2 + b**2 : print "YES" else: print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s213871436
p00003
Runtime Error
import sys for x in sys.stdin.readlines(): l = map(int,x.split()) l.remove(l[0]) a,b,c = l if c**2 == a**2 + b**2 : print "YES" else: print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s005737693
p00003
Runtime Error
a = int(input()) b = 1 while True: if b < a+1: x = map(int,input().split(' ')) x.sort() if a*2 + b*2 = c*2: print('YES') else: print('NO') b += 1 continue else: break
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s340028120
p00003
Runtime Error
a = int(input()) b = 1 while True: if b < a+1: x = map(int,input().split(' ')) x.sort() if x[0]*2 + x[1]*2 = x[2]*2: print('YES') else: print('NO') b += 1 continue else: break
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s915486742
p00003
Runtime Error
a = int(input()) b = int(1) while True: if b < a+1: x = map(int,input().split(' ')) x.sort() if x[0]**2 + x[1]**2 = x[2]**2: print('YES') else: print('NO') b += 1 continue else: break
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s593035524
p00003
Runtime Error
a = int(input()) b = int(1) while True: if b < a+1: x = map(int,input().split(' ')) x.sort() if x[0]**2 + x[1]**2 == x[2]**2: print('YES') else: print('NO') b += 1 continue else: break
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s808369827
p00003
Runtime Error
n=input() for i in range(n): x=[input(),input(),input()] x.sort() if x[0]**2+x[1]**2==x[2]**2: print("YES") else: print("NO")
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s249194620
p00003
Runtime Error
while True: try: list = [int(item) for item in raw_input().split()] list.sort() if list[0] ** 2 + list[1] ** 2 == list[2] ** 2 : print 'YES' else : print 'NO' except EOFError: break
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s823400533
p00003
Runtime Error
import sys for lineCnt, line in enumerate(sys.stdin): if lineCount == 0: continue a, b, c = map(int, line.rstrip('\n').split(' ')) if a+b>c and b+c>a and c+a>b: print 'YES' else: print 'NO'
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s726325488
p00003
Runtime Error
import sys for lineCount, line in enumerate(sys.stdin): if lineCount == 0: continue a, b, c = sorted(map(int, line.split(' '))) if a**2 + b**2 = c**2: print 'YES' else: print 'NO'
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s654990728
p00003
Runtime Error
a = int,raw_input() for i in range(0,a): x, y, z = map(int,raw_input().split()) if(x > y > z or x > z > y and x*x == y*y + z*z): print 'YES' elif(y > x > z or y > z > x and y*y == x*x + z*z): print 'YES' elif(z > x > y or z > y > z and z*z == x*x + y*y): print 'YES' else: print 'NO'
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s955452077
p00003
Runtime Error
timel = int(raw_input()) for gomi in xrange(timel): a,b,c = map(lambda x: int(x)**2, raw_input().split()) if a+b==c or b+c==a or c+a==b: print "YES" else print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s269619396
p00003
Runtime Error
for n in range(input()): a,b,c=sorted(map(int,raw_input().split())) print ["YES","NO"][c*c-a*a-b*b]
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s492213940
p00003
Runtime Error
while True: try: line = input() except: break a, b, c = map(int, line.strip().split()) print('YES' if a**2 + b**2 == c**2 else 'NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s729110277
p00003
Runtime Error
n = input() for i in range(n): a, b, c = map(int, input().strip().split()) print('YES' if a**2 + b**2 == c**2 else 'NO')
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s427695335
p00003
Runtime Error
list=[a,b,c] list.sort() A=list[0] B=list[1] C=list[2] if C**2==A**2+B**2: print "YES" else : print "NO"
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s958084856
p00003
WA: Presentation Error
import sys n = int(input()) l = sys.stdin.readlines() s = "" for i in l: x, y, z = sorted(map(lambda x:x*x,map(int, i.split()))) if x + y == z: s += "YES\n" else: s += "NO\n" print(s)
3 4 3 5 4 3 6 8 8 8
YES NO NO
<H1>Is it a Right Triangle?</H1> <p> Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so. </p> <H2>Input</H2> <p> Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. </p> <h2>Constraints</h2> <ul> <li> 1 &le; length of the side &le; 1,000</li> <li> <var>N</var> &le; 1,000</li> </ul> <H2>Output</H2> <p> For each data set, print "<span>YES</span>" or "<span>NO</span>". </p> <H2>Sample Input</H2> <pre> 3 4 3 5 4 3 6 8 8 8 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO NO </pre>
s550671590
p00004
Wrong Answer
print("hello")
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s871137084
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split(" ")) det = a * d - b * c x = det * (d * e - b * f) y = det * ((-c) * e + a * e) print(str(x), str(y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s543979782
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split(" ")) det = a * d - b * c x = det * (d * e - b * f) y = det * ((-c) * e + a * f) print(str(x), str(y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s558670358
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split(" ")) det = 1 / (a * d - b * c) x = det * (d * e - b * f) y = det * ((-c) * e + a * e) print(str(x), str(y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s802693780
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split(" ")) det = 1 / (a * d - b * c) x = det * (d * e - b * f) y = det * ((-c) * e + a * f) print('{:.3f}'.format(x), ':.3f'.format(y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s119439148
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split(" ")) det = 1 / (a * d - b * c) x = det * (d * e - b * f) y = det * ((-c) * e + a * f) print('{:.3f}'.format(x), '{:.3f}'.format(y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s001033296
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split(" ")) det = 1 / (a * e - b * d) x = det * (e * c - b * f) y = det * (a * f - c * d) print('{:.3f}'.format(x), '{:.3f}'.format(y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s843811839
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split(" ")) except: break det = 1 / (a*e - b*d) x = det * (c*f - e*b) y = det * (c*f - d*a) print("{:.3f} {:.3f}".format(x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s386743746
p00004
Wrong Answer
(a,b,c,d,e,f) = map(int,input().split()) g = (a * e) - (b * d) ans1= "{0:.3f}".format((( e * c) + ( -b * f)) / g) ans2= "{0:.3f}".format(((-d * c) + ( a * f)) / g) print (ans1,ans2)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s461350569
p00004
Wrong Answer
(a,b,c,d,e,f) = map(int,input().split()) g = (a * e) - (b * d) ans1= "{0:.3f}".format((( e * c) + ( -b * f)) / g) ans2= "{0:.3f}".format(((-d * c) + ( a * f)) / g) (a,b,c,d,e,f) = map(int,input().split()) g = (a * e) - (b * d) ans3= "{0:.3f}".format((( e * c) + ( -b * f)) / g) ans4= "{0:.3f}".format(((-d * c) + ( a * f)) / g) print (ans1,ans2) print (ans3,ans4)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s667683758
p00004
Wrong Answer
(a,b,c,d,e,f) = map(int,input().split()) g = (a * e) - (b * d) ans1= "{0:.3f}".format((( e * c) + ( -b * f)) / g + 0) ans2= "{0:.3f}".format(((-d * c) + ( a * f)) / g + 0) (a,b,c,d,e,f) = map(int,input().split()) g = (a * e) - (b * d) ans3= "{0:.3f}".format((( e * c) + ( -b * f)) / g + 0) ans4= "{0:.3f}".format(((-d * c) + ( a * f)) / g + 0) print (ans1,ans2) print (ans3,ans4)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s811548224
p00004
Wrong Answer
while 1: try: a,b,c,d,e,f = (map(int,input().split())) n = d/a a = n*a b = n*b c = n*c y = (c-f)/(b-e) x = (c-(b*y))/a print("{0:.3f} {1:.3f}".format(x, y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s662657940
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = (map(int,input().split())) n = d/a a = n*a b = n*b c = n*c y = (c-f)/(b-e) x = (c-(b*y))/a print("{0:.3f} {1:.3f}".format(x, y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s553404223
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = list(map(float, input().split())) n = d/a a = n*a b = n*b c = n*c y = (c-f)/(b-e) x = (c-(b*y))/a print("{0:.3f} {1:.3f}".format(x, y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s374466612
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = map(int,input().split()) n = d/a a = n*a b = n*b c = n*c y = (c-f)/(b-e) x = (c-(b*y))/a print("{0:.3f} {1:.3f}".format(x, y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s274158578
p00004
Wrong Answer
def equation(a,b,c,d,e,f,x): buff = a*e-b*d buff_a = a a = e/buff b = -b/buff d = -d/buff e = buff_a/buff x.append((a*c)+(b*f)) x.append((d*c)+(e*f)) count = 0 a = [] b = [] c = [] d = [] e = [] f = [] while True: try: buff = input().split() a.append(float(buff[0])) b.append(float(buff[1])) c.append(float(buff[2])) d.append(float(buff[3])) e.append(float(buff[4])) f.append(float(buff[5])) count += 1 except: break for i in range(count): ans = [] equation(a[i],b[i],c[i],d[i],e[i],f[i],ans) print('{:.4f}'.format(ans[0]),'{:.4f}'.format(ans[1]))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s737185034
p00004
Wrong Answer
while True: try: a,b,c,d,e,f=[int(i) for i in input().split()] x=(c*e-f*b)/(a*e-b*d) y=(a*f-d*c)/(a*e-b*d) print("{:.3f} {:.3f}".format(x,y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s072870758
p00004
Wrong Answer
__author__ = 'bisuk' while True: try: a, b, c, d, e, f = map(int, input().strip("\n").split(" ")) # print(a, b, c, d, e, f) z = a * e - b * d if z == 0: break x = (c * e - b * f) / z y = (f * a - c * d) / z #print(str(x) + " " + str(y)) print("{0:.3f} {1:.3f}".format(x, y)) except EOFError: break # escape from while loop
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s177412724
p00004
Wrong Answer
__author__ = 'bisuk' while True: try: a, b, c, d, e, f = map(int, input().strip("\n").split(" ")) # print(a, b, c, d, e, f) z = a * e - b * d if z == 0: break x = (c * e - b * f) y = (f * a - c * d) #print("1st: {0:.3f} {1:.3f} {2:.3f}".format(x, y, z)) # 0/0.0->False hoka->True """if x: # x != 0, 0.0 (True) x = x / z if y: y = y / z """ x /= z y /= z # zero toshite atsukau if -0.0004 < x < 0.0004: x = abs(x) if -0.0004 < y < 0.0004: y = abs(y) #print(str(x) + " " + str(y) + " " + str(z)) print("{0:.3f} {1:.3f} {2:.3f}".format(x, y, z)) except EOFError: break # escape from while loop
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s299980384
p00004
Wrong Answer
while True: try: [a, b, c, d, e, f] = map(int, raw_input().split()) i = d/a j = i * b - e k = i * c - f y = k/j x = c - b * y print "%.3f %.3f" % (x, y) except (EOFError): break;
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s635600622
p00004
Wrong Answer
while True: try: [a, b, c, d, e, f] = map(float, raw_input().split()) i = d/a j = i * b - e k = i * c - f print i, j, k y = float(k/j) x = float((c - b * y)/a) print x, y print "%.3f %.3f" % (x, y) except (EOFError): break;
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s065025851
p00004
Wrong Answer
import sys while 1: try : a,b,c,d,e,f = map(float,raw_input().split()) det = a * e - b * d x = (c*e - b*f) / det + 0.0 y = (a*f - c*d) / det + 0.0 print "%f %f" % (x,y) except EOFError : break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s580861494
p00004
Wrong Answer
import sys while 1: try : a,b,c,d,e,f = map(float,raw_input().split()) y=(a*f-c*d)/(a*e-d*b) x=(c-b*y)/a print "%f %f" % (x,y) except EOFError : break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s165305808
p00004
Wrong Answer
while True: try: (a,b,c,d,e,f)=map(float,raw_input().split()) x=(f-c*e/b)/(d-a*e/b) y=(c-a*x)/b print "%.3f %.3f" % (x,y) except EOFError: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s601317622
p00004
Wrong Answer
while True: try: [a,b,c,d,e,f] = map(float,raw_input().split(' ')) if a == 0.0: if b != 0.0: y = c / b x = 0.0 else: y = 0 x = 0 elif b == 0.0: if a != 0.0: x = c / a y = 0 elif d == 0.0: if e != 0.0: y = f / e x = 0 else: y = 0 x = 0 elif e == 0.0: if d != 0.0: x = f / d y = 0 else: x = 0 y = 0 else: y = (c / a - f / d) / (b/a - e / d) x = (c - b * y) / d print "%0.3f %0.3f" % (x,y) except (EOFError): break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s236581784
p00004
Wrong Answer
while True: try: [a,b,c,d,e,f] = map(float,raw_input().split(' ')) if a == 0.0: if b != 0.0: y = c / b x = 0.0 else: y = 0 x = 0 elif b == 0.0: if a != 0.0: x = c / a y = 0 else: y = 0 x = 0 elif d == 0.0: if e != 0.0: y = f / e x = 0 else: y = 0 x = 0 elif e == 0.0: if d != 0.0: x = f / d y = 0 else: x = 0 y = 0 else: y = (c / a - f / d) / (b/a - e / d) x = (c - b * y) / d print "%0.3f %0.3f" % (x,y) except (EOFError): break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s445351353
p00004
Wrong Answer
while True: try: [a,b,c,d,e,f] = map(float,raw_input().split(' ')) if a == 0.0: if b != 0.0: y = c / b x = 0.0 else: y = 0 x = 0 elif b == 0.0: if a != 0.0: x = c / a y = 0 else: y = 0 x = 0 elif d == 0.0: if e != 0.0: y = f / e x = 0 else: y = 0 x = 0 elif e == 0.0: if d != 0.0: x = f / d y = 0 else: x = 0 y = 0 else: y = (c / a - f / d) / (b/a - e / d) x = (c - b * y) / d if abs(x - 0.0) == 0.0: x = 0 if abs(y - 0.0) == 0.0: y = 0 print "%0.3f %0.3f" % (x,y) except (EOFError): break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s288424607
p00004
Wrong Answer
while True: try: [a,b,c,d,e,f] = map(float,raw_input().split(' ')) if a == 0.0: if b != 0.0: y = c / b x = (f - e * y) / d elif b == 0.0: if a != 0.0: x = c / a y = (f - d * x) / e elif d == 0.0: if e != 0.0: y = f / e x = (c - b * y) / a elif e == 0.0: if d != 0.0: x = f / d y = (c - a * x) / b else: y = (c / a - f / d) / (b/a - e / d) x = (c - b * y) / d if abs(x - 0.0) == 0.0: x = 0 if abs(y - 0.0) == 0.0: y = 0 print "%0.3f %0.3f" % (x,y) except (EOFError): break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s901160891
p00004
Wrong Answer
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) x = (b * f - c * e)/(a * e - b * d) y = (a * f - c * d)/(a * e - b * d) print '%f %f' % (x, y)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s511804395
p00004
Wrong Answer
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) x = (c * e - b * f)/(a * e - b * d) y = (a * f - c * d)/(a * e - b * d) print '%f %f' % (x, y)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s671235006
p00004
Wrong Answer
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) x = round((c*e-b*f) / (a*e-b*d), 3) y = round((c*d-a*f) / (b*d-a*e), 3) print '%f %f' % (x, y)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s981887801
p00004
Wrong Answer
import math import itertools while 1: try: a, b, c, d, e, f = map(int, input().split()) print('{0:.3f} {1:.3f}'.format((e*c-b*f)/(a*e-b*d), (-d*c+a*f)/(a*e-b*d))) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s939386512
p00004
Wrong Answer
def test(a, b, c, d, e, f): pass def check(): while True: try: sides = map(int, raw_input().split()) print sides except Exception, e: break if __name__ == "__main__": check() # print test(1, 2, 3, 4, 5, 5)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s798067119
p00004
Wrong Answer
def test(a, b, c, d, e, f): x = (c*e - b*f)/(a*e - b*d) y = (c*d - a*f)/(b*d - a*e) return str(x) +" "+ str(y) def check(): while True: try: params = map(int, raw_input().split()) print test(params[0], params[1], params[2], params[3], params[4], params[5]) except Exception, e: break if __name__ == "__main__": # check() print test(1, 2, 3, 4, 5, 6)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s767678348
p00004
Wrong Answer
def test(a, b, c, d, e, f): x = (c*e - b*f)/(a*e - b*d) y = (c*d - a*f)/(b*d - a*e) return str(x) +" "+ str(y) def check(): while True: try: params = map(int, raw_input().split()) print test(params[0], params[1], params[2], params[3], params[4], params[5]) except Exception, e: break if __name__ == "__main__": check() # print test(1, 2, 3, 4, 5, 6)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s863911384
p00004
Wrong Answer
def test(a, b, c, d, e, f): x = (c*e - b*f)/(a*e - b*d) y = (c*d - a*f)/(b*d - a*e) return "%.3f %.3f" % (x, y) def check(): while True: try: params = map(int, raw_input().split()) print test(params[0], params[1], params[2], params[3], params[4], params[5]) except Exception, e: break if __name__ == "__main__": check() # print test(1, 2, 3, 4, 5, 6)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s187164861
p00004
Wrong Answer
def test(a, b, c, d, e, f): x = (c*e - b*f)/(a*e - b*d) y = (c*d - a*f)/(b*d - a*e) return "%.3f %.3f" % (x, y) def check(): while True: try: params = map(int, raw_input().split()) print test(params[0], params[1], params[2], params[3], params[4], params[5]) except Exception, e: break if __name__ == "__main__": check()
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s857449893
p00004
Wrong Answer
# coding: utf8 import sys for line in sys.stdin: a, b, c, d, e, f = map(int, line.split()) x = round(1.0 * (b*f - e*c) / (b*d - a*e), 3) y = round(1.0 * (c*d - a*f) / (b*d - a*e), 3) print x, y
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>