submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s860834432
p00003
Accepted
n=int(input()) for i in range(n): a,b,c = input().split() x = int(a) y = int(b) z = int(c) p = [x,y,z] p.sort() if pow(p[0],2) + pow(p[1],2) == pow(p[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>
s007953478
p00003
Accepted
n = int(input()) for i in range(n): tri_list = list(map(int,input().split(" "))) #tri_list = input().split(" ") tri_list.sort() a = int(tri_list[2]) ** 2 b = int(tri_list[0]) ** 2 + int(tri_list[1]) ** 2 if 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>
s051363988
p00003
Accepted
n = int(input()) for i in range(n): tri_list = list(map(int,input().split(" "))) tri_list.sort() a = int(tri_list[2]) ** 2 b = int(tri_list[0]) ** 2 + int(tri_list[1]) ** 2 if 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>
s844733620
p00003
Accepted
# -*- coding: utf-8 -*- for i in range(int(input())): values = sorted(map(lambda x: int(x)**2, input().split(' '))) if values[2] == values[1] + values[0]: 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>
s192596255
p00003
Accepted
N = int(input()) for i in range(N): a = list(map(int, input().split())) a.sort() if (a[2] ** 2 == a[0] ** 2 + a[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>
s255965765
p00003
Accepted
n = int(input()) for i in range(n): x, y, z =map(int, input().split()) if x*x + y*y == z*z or y*y + z*z == x*x or x*x + z*z == 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>
s350427727
p00003
Accepted
n = int(input()) for i in range(0, n): a, b, c = sorted(map(int, input().split())) print("YES" if c*c == a*a+b*b 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>
s542299599
p00003
Accepted
n = int(raw_input()) for _ in xrange(n): ls = sorted(map(int, raw_input().split())) if ls[2]**2 == ls[0]**2+ls[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>
s323146988
p00003
Accepted
n = int(input()) for i in range(0, n): a, b, c = sorted(map(int, input().strip("\n").split(" "))) # a,b,c = sorted(input().strip("\n").split(" ")) #print(a, b, c) if c*c - (a*a + b*b) == 0: 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>
s387529505
p00003
Accepted
n = input() for i in range(n): l = map(int, raw_input().split()) 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>
s689810329
p00003
Accepted
rep = input() while rep: rep -= 1 [a, b, c] = map(int, raw_input().split()) if b < a and c < a: a **= 2 b = b ** 2 + c ** 2 elif a < b and c < b: a = a ** 2 + c ** 2 b **= 2 else: a = a ** 2 + b ** 2 b = c ** 2 if 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>
s810433694
p00003
Accepted
n = raw_input() while 1: try : a = map(int,raw_input().split()) a.sort() a.reverse() # print a if a[0]**2 == a[1]**2 + a[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>
s118011009
p00003
Accepted
import itertools def check(a,b,c): for p in itertools.permutations([a,b,c]): (x,y,z)=p if x*x+y*y==z*z: return True return False n=input() for i in range(n): (a,b,c)=map(eval,raw_input().split()) if check(a,b,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>
s616008384
p00003
Accepted
n = int(raw_input()) for i in range(n): edge = map(int,raw_input().split(" ")) e0 = edge[0] * edge[0] e1 = edge[1] * edge[1] e2 = edge[2] * edge[2] ret = "NO" if (edge[0] > edge[1]) and (edge[0] > edge[2]): if (e0 - e1 - e2) == 0: ret = "YES" if (edge[1] > edge[0]) and (edge[1] > edge[2]): if (e1 - e0 - e2) == 0: ret = "YES" if (edge[2] > edge[0]) and (edge[2] > edge[1]): if (e2 - e0 - e1) == 0: ret = "YES" print ret
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>
s357286310
p00003
Accepted
n=int(input())#nはデータセットの数 for i in range(n):#n回繰り返す edge=input().split()#入力 edge=[int(j) for j in edge]#入力 edge.sort()#ここでedge[2]が最大になる if(edge[0]**2+edge[1]**2==edge[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>
s198383691
p00003
Accepted
import sys N = int(raw_input()) for line in sys.stdin: 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>
s624725426
p00003
Accepted
#!/usr/bin/python #-coding:utf-8- import sys data_list = [] for s in sys.stdin: data_list.append( map(int,s.split()) ) for e in data_list[1:]: e.sort() if e[0]*e[0] + e[1]*e[1] == e[2] * e[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>
s175630788
p00003
Accepted
import math import itertools for i in range(int(input())): a, b, c = sorted(map(int, input().split())) print('YES' if a*a+b*b==c*c 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>
s281317515
p00003
Accepted
n = input() for i in range(n): s = map(int, raw_input().split()) s.sort() if s[2]**2 == (s[0]**2) + (s[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>
s196157452
p00003
Accepted
import sys data_list = sys.stdin.readlines() data_length = int(data_list.pop(0)) for x in xrange(data_length): lines = map(int, data_list[x].strip().split()) lines.sort(reverse = True) if lines[0]**2 == (lines[1]**2 + lines[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>
s671139398
p00003
Accepted
# coding: utf-8 # Here your code ! N = int(input()) for i in range(N): a,b,c = map(int, input().split()) flg = 0 if a*a + b*b == c*c: flg = 1 if c*c + a*a == b*b: flg = 1 if b*b + c*c == a*a: flg = 1 if flg == 1: 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>
s218549800
p00003
Accepted
for _ in range(int(input())): a=list(map(int,input().split())) a.sort() print("YES") if a[0]**2+a[1]**2==a[2]**2 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>
s077755895
p00003
Accepted
def pascal(xdata): for x in xrange(3): for y in xrange(3): for z in xrange(3): if xdata[x]**2 + xdata[y]**2 == xdata[z]**2: return True return False N = input() data = [map(int, raw_input().split()) for x in range(N)] for x in data: if pascal(x): 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>
s499399251
p00003
Accepted
#condig: UTF-8 import sys n = int(raw_input()) while True: try : a = sorted(map(int,raw_input().split())) print "YES" if a[0] ** 2 + a[1] ** 2 == a[2] ** 2 else "NO" except: 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>
s697457483
p00003
Accepted
n=int(input()) while n: n-=1 lis=list(map(int,input().split())) for i in range(3): for j in range(i+1,3): if lis[i]<lis[j]: a=lis[i] lis[i]=lis[j] lis[j]=a c,a,b=lis 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>
s494970630
p00003
Accepted
n=int(input()) for i in range(n): edge=input().split() edge=[int(j) for j in edge] edge.sort() if edge[2]**2==edge[0]**2+edge[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>
s840377102
p00003
Accepted
def check_right_triangle(side1, side2, side3): pow = 2 if side1**pow == side2**pow + side3**pow: return True if side2**pow == side3**pow + side1**pow: return True if side3**pow == side1**pow + side2**pow: return True return False def check(): for i in range(int(raw_input())): sides = map(int, raw_input().split()) if check_right_triangle(sides[0], sides[1], sides[2]): print "YES" else: print "NO" if __name__ == "__main__": check() # print check_right_triangle(4, 3, 5) # print check_right_triangle(4, 3, 6) # print check_right_triangle(8, 8, 8)
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>
s042988887
p00003
Accepted
import sys raw_input() for line in sys.stdin.readlines(): a, b, c = map(int, line.strip().split()) input_list = [a, b, c] input_list.sort() if input_list[2] ** 2 == input_list[0] ** 2 + input_list[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>
s300401860
p00003
Accepted
import sys n = int(sys.stdin.readline()) for _ in range(n): a, b, c = sorted(list(map(int, sys.stdin.readline().split()))) print('YES' if a * a + b * b == c * c 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>
s490463940
p00003
Accepted
N = input() for i in range(N): a, b, c = map(int, raw_input().split()) t1 = a**2 + b ** 2 == c ** 2 t2 = b**2 + c ** 2 == a ** 2 t3 = c**2 + a ** 2 == b ** 2 if t1 or t2 or t3: 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>
s408322804
p00003
Accepted
import math n = input() for i in range(n): flag = 0 a = map(int, raw_input().split()) if(pow(a[0],2)+pow(a[1],2) == pow(a[2],2)): flag = 1 if(pow(a[1],2)+pow(a[2],2) == pow(a[0],2)): flag = 1 if(pow(a[2],2)+pow(a[0],2) == pow(a[1],2)): flag = 1 if flag == 1: 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>
s869030402
p00003
Accepted
#!/usr/bin/env python3 def right_triangle(edge): # a < b < c return (edge[0] ** 2 + edge[1] ** 2 == edge[2] ** 2) n = int(input()) for i in range(n): edge = sorted([int(x) for x in input().split()]) if right_triangle(edge): 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>
s820178989
p00003
Accepted
n = int(raw_input()) for k in range(n): [a,b,c] = map(int,raw_input().split()) a,b,c = sorted([a,b,c]) 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>
s174777316
p00003
Accepted
#! /usr/bin/python3 a=int(input()) for i in range(a): l=list(map(int, input().split())) 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>
s238277205
p00003
Accepted
# coding: UTF-8 n = input() for n in range(n): inputs = map(int,raw_input().split()) if inputs[0]**2 == inputs[1]**2 + inputs[2]**2 or\ inputs[1]**2 == inputs[0]**2 + inputs[2]**2 or\ inputs[2]**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>
s036748899
p00003
Accepted
n = int(raw_input()) for i in range(n): temp = [int(x) for x in raw_input().split()] temp.sort(reverse = True) if temp[0] ** 2 == temp[1] ** 2 + temp[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>
s534893219
p00003
Accepted
import sys n = int(sys.stdin.readline()) for i in range(n): sides = [int(k) for k in sys.stdin.readline().split()] sides.sort() if sides[0] ** 2 + sides[1] ** 2 == sides[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>
s661247221
p00003
Accepted
for i in range(input()): x=raw_input() L=map(int,x.split(" ")) 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>
s100348117
p00003
Accepted
count=int(input()) for i in range(0, count): a = map(int, input().split(' ')) a = [j**2 for j in a] a.sort() if (a[0] + a[1] == a[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>
s928280286
p00003
Accepted
#!/usr/bin/env python # -*- coding: utf-8 -*- n = int(input()) for i in range(n): x = list(map(int, input().split())) 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>
s265755167
p00003
Accepted
N = int(raw_input()) for i in range(N): a = range(3) a[0],a[1],a[2] = map(int, raw_input().split()) a.sort() if a[0]**2 + a[1]**2 == a[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>
s704795492
p00003
Accepted
n = int(raw_input()) for i in range(0, n): li = map(int, raw_input().split()) li.sort() if li[0]**2 + li[1]**2 == li[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>
s053198381
p00003
Accepted
for i in range ( int ( input ( ) ) ): ( a, b, c ) = sorted ( list ( 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>
s083607820
p00003
Accepted
n=int(input()) for i in range(n): s=input().split(" ") s=[int(j) for j in s] s.sort() if(s[0]**2+s[1]**2==s[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>
s017575924
p00003
Accepted
# -*- config: utf-8 -*- if __name__ == '__main__': for i in range(int(raw_input())): nums = map(lambda x:x**2,map(int,raw_input().split())) flg = False for i in range(3): s = int(0) for j in range(3): if i == j : continue s += nums[j] if s == nums[i] : flg = True if flg == True : 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>
s311132788
p00003
Accepted
# -*- config: utf-8 -*- if __name__ == '__main__': for i in range(int(raw_input())): nums = map(lambda x:x**2,map(int,raw_input().split())) nums.sort() if nums[0]+nums[1] == nums[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>
s510573481
p00003
Accepted
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"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>
s056606096
p00003
Accepted
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]: print"NO"if c*c-a*a-b*b else"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>
s984275837
p00003
Accepted
#coding:UTF-8 n = input() a = [] for i in range(n): a = map(int,raw_input().split()) a.sort() if(a[2]**2 == a[0]**2 + a[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>
s501052606
p00003
Accepted
# compare function def comp(items): return (items[0]**2 + items[1]**2 == items[2]**2) # main function def main(): n = int(input()) items = [0] * 3 for tm in range(n): str = (input()).split() for i in range(3): items[i] = int(str[i]) items.sort() if(comp(items)): print("YES") else: print("NO") if __name__ == '__main__': 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>
s319946655
p00003
Accepted
def main(): input_line = raw_input() N = int(input_line) for i in range(N): input_line = raw_input() num_lis = [] for num in input_line.split(' '): num_lis.append(int(num)) num_lis.sort(reverse=True) if num_lis[0]**2 == num_lis[1]**2 + num_lis[2]**2: print('YES') else: print('NO') if __name__ == '__main__': 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>
s270108739
p00003
Accepted
num=int(input()) for i in range(num): a=list(map(int,input().split(" "))) a.sort() if(a[0]**2+a[1]**2==a[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>
s951335503
p00003
Accepted
numberOfDataSets = 0 sideLengthList = [] while 1: try: data = raw_input().split() if len(data) == 1 : numberOfDataSets = int(data[0]) if numberOfDataSets != 0 : sideLengthList = [] elif len(data) == 3 and numberOfDataSets != 0: numberOfDataSets -= 1 sideLengthList.append(data) if numberOfDataSets == 0 : # Is it a right triangle? for i in range(0, len(sideLengthList)) : a = int(sideLengthList[i][0])*int(sideLengthList[i][0]) b = int(sideLengthList[i][1])*int(sideLengthList[i][1]) c = int(sideLengthList[i][2])*int(sideLengthList[i][2]) if a + b == c or b + c == a or c + a == b : print"YES" else: print"NO" except: 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>
s060575312
p00003
Accepted
n = int(input()) i = 0 while (i < n): L = map(int, raw_input().split()) L.sort(reverse = True) if (pow(L[0], 2) == pow(L[1], 2) + pow(L[2], 2)): print "YES" else: print "NO" i += 1
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>
s411551265
p00003
Accepted
import sys n = int(input()) for i in range(n): a = sorted(list(map(int, sys.stdin.readline().split()))) print('YES' if a[0] ** 2 + a[1] ** 2 == a[2] ** 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>
s397682806
p00003
Accepted
n = int(input()) for i in range(n): a = sorted(map(int, input().split())) print('YES' if a[0] ** 2 + a[1] ** 2 == a[2] ** 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>
s959565375
p00003
Accepted
# coding: utf-8 #Problem Name: Is it a Right Triangle? #ID: tabris #Mail: t123037@kaiyodai.ac.jp n = int(raw_input()) for i in range(n): side = sorted(map(int,raw_input().split(' '))) if side[0]**2 + side[1]**2 - side[2]**2: print 'NO' else: print 'YES' ''' Sample Input 3 4 3 5 4 3 6 8 8 8 '''
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>
s946476204
p00003
Accepted
n=input() for i in range(0,n): num=map(int, raw_input().split()) num.sort() a=num[0] b=num[1] c=num[2] if c*c==a*a+b*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>
s955246536
p00003
Accepted
num = int( input() ) for j in range( num ) : inputed = list(map(int, input().split())) maxIndex = inputed.index( max(inputed) ) judger = 0; for k in range( 3 ) : if( maxIndex != k ) : judger += inputed[ k ] ** 2 if judger == ( inputed[ maxIndex ] ** 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>
s131855340
p00003
Accepted
times = int(input()) for i in range(0, times): edge = [] for e in input().split(" "): edge.append(int(e)) edge.sort() if pow(int(edge[0]), 2) + pow(int(edge[1]), 2) == pow(int(edge[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>
s023661818
p00003
Accepted
for val in range(input()): x = map(int,raw_input().split(' ')) 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>
s161090173
p00003
Accepted
count = input() for i in range(count): l = map(int, raw_input().split()) l.sort() if(l[2]**2==l[0]**2+l[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>
s437242185
p00003
Accepted
import sys N = (int)(raw_input()) a = [0,0,0] for i in range(N): a[0],a[1],a[2] = map(int,raw_input().split()) a.sort() if a[0]**2 + a[1]**2 == a[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>
s929853952
p00003
Accepted
N = int(input()) for i in range(N): num = list(map(int, input().split())) num.sort() if num[0] ** 2 + num[1] ** 2 == num[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>
s021236516
p00003
Accepted
N = int(input()) for i in range(N): num = sorted(map(int, input().split())) if num[0] ** 2 + num[1] ** 2 == num[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>
s774443725
p00003
Accepted
for i in range(int(input())): li = sorted([int(j) for j in input().split()]) print("YES" if li[0] ** 2 + li[1] ** 2 == li[2] ** 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>
s480889417
p00003
Accepted
n = int(input()) while n>0: l = [int(i) for i in input().split()] l.sort() if l[0]**2 + l[1] ** 2 == l[2] ** 2: print('YES') else: print('NO') n -= 1
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>
s816709695
p00003
Accepted
n=input() for i in range(n): a,b,c = sorted(map(int, raw_input().split())) 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>
s266474527
p00003
Accepted
N=int(input()) for line in range(N): a,b,c = (int(i) for i in input().split()) if (a**2+b**2==c**2) or (b**2+c**2==a**2) or (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>
s382529523
p00003
Accepted
n = input() for i in range(n): a, b, c = map(int, raw_input().strip().split(' ')) if a*a+b*b == c*c or a*a+c*c == b*b or c*c+b*b == a*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>
s047987559
p00003
Accepted
import sys size = int(sys.stdin.readline()) for i in range(size): line = sys.stdin.readline() line = line.split(" ") inp = [] for j in line: inp.append(int(j)) inp.sort() if (inp[0]**2+inp[1]**2==inp[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>
s003234937
p00003
Accepted
#! /usr/bin/env python3.4 import sys N = int(sys.stdin.readline()) ans = [] for i in range(N): tri = sys.stdin.readline()[:-1].split(' ', 3) newlist = [] for n in tri: newlist.append(int(n)) newlist.sort() if newlist[0]*newlist[0] + newlist[1]*newlist[1] == newlist[2]*newlist[2]: ans.append("YES") else: ans.append("NO") for a in ans: print(a)
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>
s227222385
p00003
Accepted
for i in range(int(input())): a = sorted(map(int,input().split()),reverse = True) if a[0]**2 == a[1]**2 + a[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>
s671080158
p00003
Accepted
n=int(input()) a=[] c=[] for i in range(n): a.append([]) for j in range(3): a[i].append([]) for i in range(n): #for j in range(3): a[i][0], a[i][1], a[i][2]=map(int, input().split()) a[i].sort() if(((a[i][0]*a[i][0])+(a[i][1]*a[i][1]))==(a[i][2]*a[i][2])): k="YES" c.append(k) else: k="NO" c.append(k) for i in range(n): print(c[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>
s972122810
p00003
Accepted
n = input() for x in xrange(n): sides = map(int,raw_input().split()) sides = sorted(sides) if sides[0]**2+sides[1]**2==sides[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>
s088116763
p00003
Accepted
n = input() for i in xrange(n): li = map(int, raw_input().split()) li.sort() if li[0]**2 + li[1]**2 == li[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>
s999414085
p00003
Accepted
a = int(input()) for _ in range(a): b, c, d = sorted(map(int, input().split())) if b**2+c**2 == d**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>
s893936480
p00003
Accepted
N = int(raw_input()) for n in range(N): data_set = map(int, raw_input().split()) a = data_set[0] b = data_set[1] c = data_set[2] if (a ** 2 + b ** 2) == (c ** 2) or (a ** 2 + c ** 2) == (b ** 2) or (b ** 2 + c ** 2) == (a ** 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>
s945523259
p00003
Accepted
import sys input() print('\n'.join('YES' if t[0] ** 2 + t[1] ** 2 == t[2] ** 2 else 'NO' for t in [sorted(map(int, l.split())) for l in sys.stdin]))
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>
s087804725
p00003
Accepted
N = input() a = [] for i in range(N): a = map(int, raw_input().split()) b = [0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 if b[0]**2 == b[1]**2 + b[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>
s472306008
p00003
Accepted
num = int(input()) for i in range (num): a=sorted(list(map(int,input().split()))) if a[0]**2+a[1]**2 == (a[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>
s212667647
p00003
Accepted
import string import sys import math #??????????????\????????????ip?????\?????? ip = sys.stdin.readlines() ip_list = {} #?????????????????§????????? for i in range(len(ip)): ip_list[i] = ip[i].strip("\n").split() for i in range(1,len(ip)): for j in range(3): #????????????????????? for t in range(3): for k in range(3): if int(ip_list[i][t]) > int(ip_list[i][k]): tmp = ip_list[i][t] ip_list[i][t] = ip_list[i][k] ip_list[i][k] = tmp for i in range(1,len(ip)): if int(ip_list[i][0])**2 == int(ip_list[i][1])**2 + int(ip_list[i][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>
s713575417
p00003
Accepted
N = int(input()) ary=[] ans=[] for i in range(N): ary.append(list(map(int,(input().split())))) if 2 * max(ary[-1]) ** 2 == sum(ary[-1][j] ** 2 for j in range(3)): ans.append('YES') else: ans.append('NO') print('\n'.join(ans))
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>
s297657178
p00003
Accepted
n = int(raw_input()) for i in range(n): a = map(int,raw_input().split()) a.sort() if (a[0]**2 + a[1]**2) == a[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>
s998803133
p00003
Accepted
import sys n = int(raw_input()) a = [0,0,0] for i in range(n): a[0],a[1],a[2] = map(int,raw_input().split()) a.sort() if a[0]**2 + a[1]**2 == a[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>
s918053780
p00003
Accepted
n = int(raw_input()) a = [0,0,0] for i in range(n): a[0],a[1],a[2] = map(int,raw_input().split()) a.sort() if a[0]**2 + a[1]**2 == a[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>
s444783221
p00003
Accepted
n = input() for i in xrange(n): tmp = map(int, raw_input().split()) if tmp[0]**2 + tmp[1]**2 == tmp[2]**2 or tmp[1]**2 + tmp[2]**2 == tmp[0]**2 or tmp[2]**2 + tmp[0]**2 == tmp[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>
s315850635
p00003
Accepted
#coding:utf-8 i = input() q = [] for n in range(i): l = map(int, raw_input(). split()) a = min(l) l.remove(min(l)) b = min(l) c = max(l) if a ** 2 + b ** 2 == c ** 2: q.append("YES") else: q.append("NO") for s in xrange(len(q)): print(q[0]) q.pop(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>
s859661536
p00003
Accepted
n=int(input()) for i in range(n): A=[int(j) for j in input().split()] A.sort() if A[0]**2+A[1]**2==A[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>
s017167883
p00003
Accepted
x = input() for i in xrange(x): inp = map(int ,raw_input().split()) inp.sort() if inp[2]**2 == inp[0]**2 + inp[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>
s069730447
p00003
Accepted
n = int(input()) for i in range(n): s = input().split(" ") s = [int(j) for j in s] s.sort() a = s[0] b = s[1] c = s[2] 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>
s105699140
p00003
Accepted
N=int(input()) for n in range(N): sides = list(map(int,input().split())) sides.sort() if sides[-1]**2 == sides[-2]**2 + sides[-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>
s305377844
p00003
Accepted
# -*- coding: utf-8 -*- N = int(raw_input()) for i in range(N): a, b, c = map(int, raw_input().split()) if a > c: a, c = c, a if b > c: b, c = c, b 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>
s250090723
p00003
Accepted
n = int(input()) for cnt in range(n): t = list(map(int, input().split())) t.sort() if t[2]**2 == t[1]**2 + t[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>
s731294111
p00003
Accepted
# coding: utf-8 N = int(raw_input()) dataList = [] for i in range(N): list = map(int, raw_input().split()) dataList.append(list) # find max number for i in range(len(dataList)): idx = dataList[i].index(max(dataList[i])) lar = dataList[i][idx] del dataList[i][idx] if lar**2 == dataList[i][0] ** 2 + dataList[i][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>
s202074087
p00003
Accepted
n = int(input()) for i in range(n): a,b,c = map(int,input().split(" ")) if a**2 == b**2 + c**2: print("YES") elif b**2 == a**2 + c**2: print("YES") elif 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>
s407313624
p00003
Accepted
#Is it Right Triangre? n = int(input()) for i in range(n): set = input(). split() set = [int(a) for a in set] #int????????? set.sort() if set[0] ** 2 + set[1] ** 2 == set[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>
s264373897
p00003
Accepted
delta = int(input()) tri_all = [] for i in range(delta): tri = list(map(int, input().split(' '))) tri.sort() tri_all.append(tri) for i in range(len(tri_all)): if tri_all[i][0]**2 + tri_all[i][1]**2 == tri_all[i][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>
s624331800
p00003
Accepted
n=input() for i in xrange(n): a,b,c=map(int,raw_input().split()) if a**2+b**2==c**2 or a**2+c**2==b**2 or b**2+c**2==a**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>
s487426258
p00003
Accepted
def check(List): List.sort() List.reverse() if List[0]**2 == List[1]**2+List[2]**2: return "YES" else: return "NO" N = input() for i in range(N): list = map(int, raw_input().split()) print check(list)
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>