s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s265755167
p00003
u396642573
1428913837
Python
Python
py
Accepted
20
4220
207
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,602
s704795492
p00003
u886766186
1430234348
Python
Python
py
Accepted
20
4212
184
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'
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,603
s053198381
p00003
u009961299
1430541735
Python
Python3
py
Accepted
40
6724
197
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" )
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,604
s083607820
p00003
u308369184
1430562884
Python
Python3
py
Accepted
40
6720
233
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,605
s017575924
p00003
u577850777
1431242897
Python
Python
py
Accepted
20
4232
354
# -*- 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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,606
s311132788
p00003
u577850777
1431243012
Python
Python
py
Accepted
20
4212
227
# -*- 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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,607
s510573481
p00003
u067299340
1432213289
Python
Python
py
Accepted
20
4332
107
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,608
s163922730
p00003
u067299340
1432213302
Python
Python
py
Accepted
20
4332
107
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,609
s030593257
p00003
u067299340
1432213311
Python
Python
py
Accepted
20
4332
107
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,610
s122888043
p00003
u067299340
1432213380
Python
Python
py
Accepted
20
4332
107
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,611
s624714161
p00003
u067299340
1432213416
Python
Python
py
Accepted
20
4332
107
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,612
s408574753
p00003
u067299340
1432213480
Python
Python
py
Accepted
20
4328
107
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,613
s056606096
p00003
u067299340
1432213613
Python
Python
py
Accepted
10
4332
109
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,614
s619131137
p00003
u067299340
1432213651
Python
Python
py
Accepted
10
4332
107
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,615
s984275837
p00003
u682755774
1433094142
Python
Python
py
Accepted
20
4212
213
#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'
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,616
s501052606
p00003
u940190657
1433655877
Python
Python3
py
Accepted
40
6720
431
# 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()
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,617
s319946655
p00003
u873482706
1434186778
Python
Python
py
Accepted
20
4228
421
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()
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,618
s270108739
p00003
u492083164
1434792005
Python
Python3
py
Accepted
50
6724
153
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,619
s951335503
p00003
u622015302
1435430256
Python
Python
py
Accepted
20
4388
697
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
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,620
s060575312
p00003
u472944603
1437529663
Python
Python
py
Accepted
20
4212
219
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
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,621
s411551265
p00003
u777299405
1437645582
Python
Python3
py
Accepted
40
6720
173
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')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,622
s397682806
p00003
u777299405
1437645828
Python
Python3
py
Accepted
40
6720
142
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')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,623
s959565375
p00003
u722431421
1439451292
Python
Python
py
Accepted
20
4228
324
# 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 '''
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,624
s946476204
p00003
u071744613
1441160989
Python
Python
py
Accepted
10
6240
159
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,625
s955246536
p00003
u651428295
1442476655
Python
Python3
py
Accepted
50
7464
347
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,626
s131855340
p00003
u985809245
1442585293
Python
Python3
py
Accepted
40
7612
232
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,627
s023661818
p00003
u271261336
1442976341
Python
Python
py
Accepted
20
6324
145
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'
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,628
s161090173
p00003
u948218832
1443964124
Python
Python
py
Accepted
10
6236
149
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,629
s437242185
p00003
u802625365
1446203790
Python
Python
py
Accepted
10
6224
209
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,630
s929853952
p00003
u695952004
1447166990
Python
Python3
py
Accepted
40
7572
169
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,631
s021236516
p00003
u695952004
1447167195
Python
Python3
py
Accepted
40
7540
159
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,632
s774443725
p00003
u362869314
1447176356
Python
Python3
py
Accepted
40
7548
148
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,633
s480889417
p00003
u775586391
1447933188
Python
Python3
py
Accepted
60
7616
167
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
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,634
s816709695
p00003
u282982700
1448952207
Python
Python
py
Accepted
20
6372
153
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,635
s266474527
p00003
u468759892
1449382947
Python
Python3
py
Accepted
40
7524
201
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')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,636
s382529523
p00003
u461370825
1449734723
Python
Python
py
Accepted
20
6288
172
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,637
s047987559
p00003
u825618558
1450029031
Python
Python3
py
Accepted
30
7668
290
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,638
s003234937
p00003
u609881501
1450231780
Python
Python3
py
Accepted
30
7636
402
#! /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)
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,639
s227222385
p00003
u982618289
1450257631
Python
Python3
py
Accepted
40
7540
173
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,640
s671080158
p00003
u560214129
1450418928
Python
Python3
py
Accepted
30
7940
404
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])
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,641
s972122810
p00003
u512342660
1450974064
Python
Python
py
Accepted
20
6316
192
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,642
s088116763
p00003
u529386725
1452169304
Python
Python
py
Accepted
20
6372
177
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,643
s999414085
p00003
u088437533
1452473236
Python
Python3
py
Accepted
40
7548
160
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,644
s893936480
p00003
u580607517
1452611227
Python
Python
py
Accepted
20
6332
279
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,645
s945523259
p00003
u797673668
1452681098
Python
Python3
py
Accepted
30
7852
165
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]))
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,646
s087804725
p00003
u302511098
1452792840
Python
Python
py
Accepted
20
6248
240
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,647
s472306008
p00003
u372789658
1454690898
Python
Python3
py
Accepted
40
7524
173
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,648
s212667647
p00003
u386731818
1454944743
Python
Python3
py
Accepted
100
8692
732
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,649
s713575417
p00003
u650459696
1454993893
Python
Python3
py
Accepted
40
7744
253
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))
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,650
s297657178
p00003
u529340193
1456303744
Python
Python
py
Accepted
20
6252
178
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,651
s998803133
p00003
u867824281
1456753527
Python
Python
py
Accepted
20
6340
217
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,652
s918053780
p00003
u867824281
1456754125
Python
Python
py
Accepted
20
6256
204
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,653
s444783221
p00003
u000228958
1456830843
Python
Python
py
Accepted
10
6228
240
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,654
s315850635
p00003
u811773570
1457958888
Python
Python
py
Accepted
10
6260
303
#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)
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,655
s859661536
p00003
u075836834
1457978232
Python
Python3
py
Accepted
40
7656
146
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,656
s017167883
p00003
u148101999
1458209464
Python
Python
py
Accepted
20
6324
179
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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,657
s069730447
p00003
u915343634
1458272420
Python
Python3
py
Accepted
40
7612
219
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,658
s105699140
p00003
u919202930
1459700514
Python
Python3
py
Accepted
40
7664
172
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,659
s305377844
p00003
u130979865
1459853548
Python
Python
py
Accepted
10
6232
248
# -*- 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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,660
s250090723
p00003
u572790226
1460033264
Python
Python3
py
Accepted
40
7504
178
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')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,661
s731294111
p00003
u271525554
1460561391
Python
Python
py
Accepted
20
6508
393
# 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"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,662
s202074087
p00003
u454259029
1460822706
Python
Python3
py
Accepted
40
7656
257
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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,663
s407313624
p00003
u811773570
1461488434
Python
Python3
py
Accepted
60
7624
247
#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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,664
s264373897
p00003
u791170614
1461618785
Python
Python3
py
Accepted
40
7808
259
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')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,665
s624331800
p00003
u894114233
1461759659
Python
Python
py
Accepted
40
6320
182
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')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,666
s487426258
p00003
u018967850
1462453216
Python
Python
py
Accepted
20
6416
246
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)
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,667
s526735685
p00003
u412890344
1463395960
Python
Python3
py
Accepted
40
7792
500
#-*-coding:utf-8-*- def get_input(): for i in range(int(input())): yield "".join(input()) if __name__ == "__main__": array = list(get_input()) for i in range(len(array)): a,b,c = array[i].split() if int(a)**2 + int(b)**2 == int(c)**2: print(u"YES") elif int(c)**2 + int(a)**2 == int(b)**2: print(u"YES") elif int(b)**2 + int(c)**2 == int(a)**2: print(u"YES") else: print(u"NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,668
s546252544
p00003
u403901064
1464534868
Python
Python3
py
Accepted
40
7636
284
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): num = int(input()) for i in range(num): tri = [int(x) for x in input().split(" ")] tri.sort() if tri[2] ** 2 == tri[0] ** 2 + tri[1] ** 2: print("YES") else: print("NO") if __name__ == '__main__': main()
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,669
s602497987
p00003
u957021485
1465555484
Python
Python3
py
Accepted
40
7900
313
import itertools import operator line = int(input()) inputs = [input() for _ in range(line)] def is_right_triangle(a, b, c): a, b, c = list(sorted([a,b,c])) return a**2 + b**2 == c**2 for line in inputs: a, b, c = line.split() print("YES" if is_right_triangle(int(a), int(b), int(c)) else "NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,670
s443022799
p00003
u203261375
1466232419
Python
Python3
py
Accepted
50
7584
188
for i in range(int(input())): a,b,c = map(int, 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")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,671
s482425461
p00003
u617990214
1467126231
Python
Python3
py
Accepted
40
7652
197
n=int(input()) a_list=[] for i in range(n): k=list(map(int,input().split(" "))) L,M,N=sorted(k) if L**2+M**2==N**2: a_list.append("YES") else: a_list.append("NO") for i in a_list: print(i)
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,672
s695745765
p00003
u935184340
1467528162
Python
Python3
py
Accepted
40
7832
192
import sys r = [] n = int(input()) l = sys.stdin.readlines() for i in l: x, y, z = sorted(map(lambda x:x*x,map(int, i.split()))) if x + y == z: print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,673
s444816349
p00003
u935184340
1467528256
Python
Python3
py
Accepted
30
7708
210
import sys n = int(input()) l = sys.stdin.readlines() s = "" for i in l: x, y, z = sorted(map(lambda x:x*x,map(int, i.split()))) if x + y == z: s += "YES\n" else: s += "NO\n" print(s,end="")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,674
s682851484
p00003
u935184340
1467528314
Python
Python3
py
Accepted
30
7644
223
import sys n = int(sys.stdin.readline()) l = sys.stdin.readlines() s = "" for i in l: x, y, z = sorted(map(lambda x:x*x,map(int, i.split()))) if x + y == z: s += "YES\n" else: s += "NO\n" print(s,end="")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,675
s211108762
p00003
u935184340
1467530350
Python
Python3
py
Accepted
30
7624
197
n = int(input()) s = "" for i in range(n): l = list(map(lambda x:x*x,map(int, input().split()))) l.sort() if l[0] + l[1] == l[2]: s += "YES\n" else: s += "NO\n" print(s,end="")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,676
s494481919
p00003
u748033250
1468056003
Python
Python3
py
Accepted
60
7580
209
# coding: utf-8 num = int(input()) for i in range(num): ls = list([int(i) for i in input().split()]) ls.sort() if ls[0]**2 + ls[1]**2 == ls[2]**2: print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,677
s909669462
p00003
u264972437
1468335062
Python
Python3
py
Accepted
50
7616
157
line = int(input()) for i in range(line): a,b,c = sorted([int(i) for i in input().split(' ')]) if a**2 + b**2 == c**2: print('YES') else: print('NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,678
s722534124
p00003
u146816547
1468967987
Python
Python
py
Accepted
20
6236
163
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'
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,679
s211112593
p00003
u896025703
1469450213
Python
Python3
py
Accepted
50
7544
144
N = int(input()) for _ in range(N): a = sorted(map(int, input().split())) if a[2]**2 == a[0]**2 + a[1]**2: print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,680
s800700164
p00003
u626838615
1469573800
Python
Python3
py
Accepted
40
7596
192
n = int(input()) for i in range(n): side = list(map(int,input().split())) side.sort() if(side[0]**2 + side[1]**2 == side[2]**2): print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,681
s650079664
p00003
u582608581
1470280299
Python
Python3
py
Accepted
80
7364
214
def IsRightTriangle(tri): tri.sort() return tri[0]**2 + tri[1]**2 == tri[2]**2 N = eval(input()) for i in range(N): tri = [eval(item) for item in input().split()] print('YES' if IsRightTriangle(tri) else 'NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,682
s837395679
p00003
u358919705
1471812449
Python
Python3
py
Accepted
40
7632
176
for _ in range(int(input())): l = list(map(int, input().split())) l.sort() if l[0] ** 2 + l[1] ** 2 == l[2] ** 2: print('YES') else: print('NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,683
s707815367
p00003
u589886885
1471931512
Python
Python3
py
Accepted
50
7712
179
n = int(input()) for i in range(n): a = sorted([int(x) for x in input().split()]) if a[0] ** 2 + a[1] ** 2 == a[2] ** 2: print('YES') else: print('NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,684
s331735557
p00003
u350804311
1473201657
Python
Python3
py
Accepted
50
7668
346
N = int(input()) a = [] for i in range(N): a = list(map(int, input().split())) side_a = a[0] side_b = a[1] side_c = a[2] if side_a ** 2 + side_b ** 2 == side_c ** 2 \ or side_c ** 2 + side_b ** 2 == side_a ** 2 \ or side_a ** 2 + side_c ** 2 == side_b ** 2: print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,685
s701001259
p00003
u058433718
1473930747
Python
Python3
py
Accepted
30
7776
409
import sys def is_right(edges): max_len = max(edges) edges.remove(max_len) return max_len ** 2 == edges[0] ** 2 + edges[1] ** 2 num = int(sys.stdin.readline().strip()) for i in range(num): data = sys.stdin.readline().strip().split(' ') a = int(data[0]) b = int(data[1]) c = int(data[2]) if is_right([a, b, c]): print('YES') else: print('NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,686
s744582203
p00003
u393305246
1474188101
Python
Python
py
Accepted
20
6372
153
n=input() for i in range(n): inl=map(int, raw_input().split()) inl.sort() if inl[0]**2+inl[1]**2==inl[2]**2: print "YES" else: print "NO"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,687
s917502524
p00003
u545973195
1475218911
Python
Python3
py
Accepted
40
7616
233
def d(a): return int(a) N=int(input()) answer="" for i in range(N): if answer!="": answer+="\n" a=input().split() a.sort(key=d) if int(a[0])**2+int(a[1])**2==int(a[2])**2: answer+="YES" else: answer+="NO" print(answer)
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,688
s333472329
p00003
u505912349
1475832974
Python
Python3
py
Accepted
30
7748
349
import sys for line in sys.stdin: try: a,b,c = [int(x) for x in line.split()] if (a**2+b**2) == c**2: print('YES') elif (a**2+c**2) == b**2: print('YES') elif (b**2+c**2) == a**2: print('YES') else: print('NO') except(ValueError): continue
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,689
s961363643
p00003
u505912349
1475840513
Python
Python3
py
Accepted
30
7664
344
import sys for line in sys.stdin: try: a,b,c = [int(x) for x in line.split()] if (a**2+b**2) == c**2: print('YES') elif (a**2+c**2) == b**2: print('YES') elif (b**2+c**2) == a**2: print('YES') else: print('NO') except(ValueError): continue
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,690
s544190956
p00003
u252368621
1476026462
Python
Python3
py
Accepted
40
7632
206
num=int(input()) for i in range(num): list=[int(i) for i in input().split()] list.sort(); if pow(list[0],2) + pow(list[1],2) == pow(list[2],2): print('YES') else: print('NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,691
s203142316
p00003
u935184340
1476193979
Python
Python3
py
Accepted
30
7836
144
import sys n = input() for a,b,c in map(lambda x: sorted(map(int,x.split())),sys.stdin.readlines()): print("YES" if a*a+b*b==c*c else "NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,692
s491989704
p00003
u508732591
1476194235
Python
Python3
py
Accepted
30
7808
176
import sys input() for a,b,c in map(lambda x: sorted(map(int,x.split())),sys.stdin.readlines()): if a**2 + b**2 == c**2: print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,693
s861644273
p00003
u661290476
1476267090
Python
Python3
py
Accepted
40
7804
172
n=int(input()) r=[0]*n for i in range(n): r[i]=sorted(list(map(int,input().split()))) for i in range(n): print("YES" if r[i][0]**2+r[i][1]**2==r[i][2]**2 else "NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,694
s252707164
p00003
u159356473
1476322013
Python
Python3
py
Accepted
30
7692
409
#coding:UTF-8 def Rec(N,List): for i in range(N): a=int(List[i].split(" ")[0]) b=int(List[i].split(" ")[1]) c=int(List[i].split(" ")[2]) if a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a: print("YES") else: print("NO") if __name__=="__main__": List=[] N=int(input()) for i in range(N): List.append(input()) Rec(N,List)
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,695
s883539188
p00003
u813534019
1477067007
Python
Python
py
Accepted
20
6260
127
n=input() for _ in xrange(n): l=sorted(map(int, raw_input().split())) print "YES" if l[2]**2 == l[1]**2 + l[0]**2 else "NO"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,696
s348279267
p00003
u776559258
1477534251
Python
Python3
py
Accepted
50
7524
146
n=int(input()) for i in range(n): x=[int(j) for j in input().split()] x.sort() if x[2]**2==x[0]**2+x[1]**2: print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,697
s843703966
p00003
u500396695
1477631354
Python
Python3
py
Accepted
40
7944
194
n = int(input()) L = [input() for i in range(n)] for line in L: A = line.split() B = sorted([int(A[i]) for i in range(3)]) if B[2]**2 == B[0]**2 + B[1]**2: print('YES') else: print('NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,698
s466723739
p00003
u114472050
1477668233
Python
Python3
py
Accepted
40
7632
186
N = int(input()) for i in range(N): line = input() a, b, c = sorted(int(w) for w in line.split()) if a**2 + b**2 == c**2: print('YES') else: print('NO')
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,699
s584084676
p00003
u766597310
1477669951
Python
Python
py
Accepted
20
6268
215
def isRTri(a, b, c): return a * a + b * b == c * c a = [0, 0, 0] n = input() for k in range(n): a = map(int, raw_input().split()) a.sort() r = isRTri(a[0], a[1], a[2]) print "YES" if r else "NO"
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,700
s099119705
p00003
u659302741
1477675792
Python
Python3
py
Accepted
50
7652
232
import sys n = int(input()) for i in range(n): ns = [x * x for x in map(int, input().split())] if ns[0] + ns[1] == ns[2] or ns[0] + ns[2] == ns[1] or ns[1] + ns[2] == ns[0]: print("YES") else: print("NO")
p00003
<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>
3 4 3 5 4 3 6 8 8 8
YES NO NO
2,701