buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <algorithm> #include <iostream> using namespace std; int main() { int t, n[3]; cin >> t; while (t--) { cin >> n[0] >> n[1] >> n[2]; sort(n, n + 2); for (int i = 0; i < 3; i++) n[i] *= n[i]; if (n[2] - n[0] - n[1]) cout << "NO" << endl; else cout << "YES" << endl; } return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int t, n[3]; cin >> t; while (t--) { cin >> n[0] >> n[1] >> n[2]; sort(n, n + 3); for (int i = 0; i < 3; i++) n[i] *= n[i]; if (n[2] - n[0] - n[1]) cout << "NO" << endl; else cout << "YES" << endl; } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
120
#include <algorithm> #include <iostream> int main() { using namespace std; int num; int line[1000][3]; cin >> num; for (int i = 0; i < num; i++) { cin >> line[i][0] >> line[i][1] >> line[i][2]; sort(line[i], line[i] + 3); } for (int i = 0; i < num; i++) { if (((line[i][0] * line[i][0]) + (line[i][1] * line[i][1])) == (line[i][0] * line[i][0])) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
#include <algorithm> #include <iostream> int main() { using namespace std; int num; int line[1000][3]; cin >> num; for (int i = 0; i < num; i++) { cin >> line[i][0] >> line[i][1] >> line[i][2]; sort(line[i], line[i] + 3); } for (int i = 0; i < num; i++) { if (((line[i][0] * line[i][0]) + (line[i][1] * line[i][1])) == (line[i][2] * line[i][2])) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
[["-", 12, 23, 0, 16, 31, 69, 341, 342, 0, 13], ["+", 12, 23, 0, 16, 31, 69, 341, 342, 0, 13], ["-", 12, 23, 0, 16, 12, 69, 341, 342, 0, 13], ["+", 12, 23, 0, 16, 12, 69, 341, 342, 0, 13]]
1
181
#include <iostream> #include <stdio.h> using namespace std; int main(void) { int deta; //データ数をもらう scanf("%d", &deta); //データ数だけ3辺の値をもらう for (int i = 0; i < deta; i++) { int hen1, hen2, hen3; scanf("%d", &hen1); scanf("%d", &hen2); scanf("%d", &hen3); //直角三角形の判定 if (hen1 * hen1 + hen2 * hen2 == hen3 * hen3 || hen2 * hen2 + hen3 * hen3 == hen1 * hen1 || hen3 * hen3 + hen1 * hen1 == hen2 * hen2) { printf("yes\n"); } else { printf("no\n"); } } return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main(void) { int deta; //データ数をもらう scanf("%d", &deta); //データ数だけ3辺の値をもらう for (int i = 0; i < deta; i++) { int hen1, hen2, hen3; scanf("%d", &hen1); scanf("%d", &hen2); scanf("%d", &hen3); //直角三角形の判定 if (hen1 * hen1 + hen2 * hen2 == hen3 * hen3 || hen2 * hen2 + hen3 * hen3 == hen1 * hen1 || hen3 * hen3 + hen1 * hen1 == hen2 * hen2) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
146
#include <algorithm> #include <iostream> using namespace std; int main() { int n, a[3]; cin >> n; for (int i = 0; i < n; i++) { cin >> a[0] >> a[1] >> a[2]; std::sort(a, a + 2); cout << (a[0] * a[0] + a[1] * a[1] == a[2] * a[2] ? "YES" : "NO") << endl; } return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int n, a[3]; cin >> n; for (int i = 0; i < n; i++) { cin >> a[0] >> a[1] >> a[2]; std::sort(a, a + 3); cout << (a[0] * a[0] + a[1] * a[1] == a[2] * a[2] ? "YES" : "NO") << endl; } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
117
#include <stdio.h> int main(void) { int dsnum, length[3], i; scanf("%d", &dsnum); while (dsnum > 0) { scanf("%d%d%d", &length[0], &length[1], &length[2]); for (i = 0; i < 3; i++) { if (length[i] * length[i] + length[(i + 1) % 3] * length[(i + 1) % 3] == length[(i + 2) % 3] * length[(i + 2) % 3]) { printf("YES"); break; } if (i == 2) printf("NO"); } dsnum--; } return 0; }
#include <stdio.h> int main(void) { int dsnum, length[3], i; scanf("%d", &dsnum); while (dsnum > 0) { scanf("%d%d%d", &length[0], &length[1], &length[2]); for (i = 0; i < 3; i++) { if (length[i] * length[i] + length[(i + 1) % 3] * length[(i + 1) % 3] == length[(i + 2) % 3] * length[(i + 2) % 3]) { printf("YES\n"); break; } if (i == 2) printf("NO\n"); } dsnum--; } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
163
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int i, b, c, d; vector<int> a; cin >> i; for (int j = 0; j < i; j++) { cin >> b >> c >> d; a.push_back(b); a.push_back(c); a.push_back(d); sort(a.begin(), a.end()); if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { cout << "YES" << endl; } else { cout << "NO" << endl; } } }
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int i, b, c, d; vector<int> a; cin >> i; for (int j = 0; j < i; j++) { cin >> b >> c >> d; a.push_back(b); a.push_back(c); a.push_back(d); sort(a.begin(), a.end()); if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { cout << "YES" << endl; } else { cout << "NO" << endl; } a.clear(); } }
[["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
148
#include <algorithm> #include <deque> #include <iostream> int main() { using namespace std; deque<int> edge; int iedge[3]; int j; int a, b, c; cin >> j; for (int l = 0; l < j; l++) { for (int i = 0; i < 3; i++) { cin >> iedge[i]; edge.push_back(iedge[i]); } sort(edge.begin(), edge.end()); a = edge[0]; b = edge[1]; c = edge[2]; if (c * c == (a * a + b * b)) cout << "YES\n"; else cout << "NO\n"; } return 0; }
#include <algorithm> #include <deque> #include <iostream> int main() { using namespace std; deque<int> edge; int iedge[3]; int j; int a, b, c; cin >> j; for (int l = 0; l < j; l++) { for (int i = 0; i < 3; i++) { cin >> iedge[i]; edge.push_back(iedge[i]); } sort(edge.begin(), edge.end()); a = edge[0]; b = edge[1]; c = edge[2]; if (c * c == (a * a + b * b)) cout << "YES\n"; else cout << "NO\n"; edge.clear(); } return 0; }
[["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
161
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <iterator> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> tri(3); while (n > 0) { cin >> tri[0] >> tri[1] >> tri[2]; sort(tri.begin(), tri.end()); if (pow(tri[0], 2) + pow(tri[1], 2) == pow(tri[2], 2)) cout << "Yes" << endl; else cout << "No" << endl; n--; } return 0; }
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <iterator> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> tri(3); while (n > 0) { cin >> tri[0] >> tri[1] >> tri[2]; sort(tri.begin(), tri.end()); if (pow(tri[0], 2) + pow(tri[1], 2) == pow(tri[2], 2)) cout << "YES" << endl; else cout << "NO" << endl; n--; } return 0; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
139
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; bool judge[n]; for (int i = 0; i < n; i++) { int length[3]; for (int j = 0; j < 3; j++) { cin >> length[j]; } sort(length, length + 2); if (length[0] * length[0] + length[1] * length[1] == length[2] * length[2]) { judge[i] = true; } else { judge[i] = false; } } for (int i = 0; i < n; i++) { if (judge[i] == true) { cout << "YES" << endl; } else { cout << "NO" << endl; } } }
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; bool judge[n]; for (int i = 0; i < n; i++) { int length[3]; for (int j = 0; j < 3; j++) { cin >> length[j]; } sort(length, length + 3); if (length[0] * length[0] + length[1] * length[1] == length[2] * length[2]) { judge[i] = true; } else { judge[i] = false; } } for (int i = 0; i < n; i++) { if (judge[i] == true) { cout << "YES" << endl; } else { cout << "NO" << endl; } } }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
178
#include <iostream> using namespace std; bool solve(int x, int y, int z) { if ((x * x) == (y * y + z * z)) { return true; } return false; } int main() { int N; cin >> N; bool ans = false; for (int i = 0; i < N; i++) { int a, b, c; cin >> a >> b >> c; if (a > b) { if (a > c) // 最大値はa { ans = solve(a, b, c); } else if (a < c) // 最大値はc { ans = solve(c, a, b); } } else if (a < b) { if (b > c) // 最大値はb { ans = solve(b, a, c); } else if (b < c) // 最大値はc { ans = solve(c, a, b); } } if (ans) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }
#include <iostream> using namespace std; bool solve(int x, int y, int z) { if ((x * x) == (y * y + z * z)) { return true; } return false; } int main() { int N; cin >> N; bool ans = false; for (int i = 0; i < N; i++) { int a, b, c; cin >> a >> b >> c; if (a >= b) { if (a >= c) // 最大値はa { ans = solve(a, b, c); } else if (a < c) // 最大値はc { ans = solve(c, a, b); } } else if (a < b) { if (b >= c) // 最大値はb { ans = solve(b, a, c); } else if (b < c) // 最大値はc { ans = solve(c, a, b); } } if (ans) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
222
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int a, b, c; int num; cin >> num; for (int i = 0; i < num; i++) { cin >> a >> b >> c; if (a >= b && a >= c) { (a * a == b * b + c * c) ? cout << "Yes\n" : cout << "No\n"; } else if (b >= a && b >= c) { (b * b == a * a + c * c) ? cout << "Yes\n" : cout << "No\n"; } else if (c >= a && c >= b) { (c * c == b * b + a * a) ? cout << "Yes\n" : cout << "No\n"; } } return 0; }
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int a, b, c; int num; cin >> num; for (int i = 0; i < num; i++) { cin >> a >> b >> c; if (a >= b && a >= c) { (a * a == b * b + c * c) ? cout << "YES\n" : cout << "NO\n"; } else if (b >= a && b >= c) { (b * b == a * a + c * c) ? cout << "YES\n" : cout << "NO\n"; } else if (c >= a && c >= b) { (c * c == b * b + a * a) ? cout << "YES\n" : cout << "NO\n"; } } return 0; }
[["-", 0, 1, 0, 41, 64, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 41, 64, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 41, 75, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 41, 75, 16, 12, 5, 0, 6]]
1
179
#include <stdio.h> int main() { int N = 0, a = 0, b = 0, c = 0, i; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d %d %d", a, b, c); if (a * a + b * b == c * c) { printf("YES\n"); } else if (a * a + c * c == b * b) { printf("YES\n"); } else if (b * b + c * c == a * a) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }
#include <stdio.h> int main() { int N = 0, a = 0, b = 0, c = 0, i; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d %d %d", &a, &b, &c); if (a * a + b * b == c * c) { printf("YES\n"); } else if (a * a + c * c == b * b) { printf("YES\n"); } else if (b * b + c * c == a * a) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
1
153
#include <iostream> inline bool is_right_triangle(const u_int a, const u_int b, const u_int c) { return (a * a == b * b + c * c || b * b == c * c + a * a || c * c == a * a + b * b); } int main(void) { u_int n, a, b, c; std::cin >> n; for (u_int i = 0; i < n; ++i) { std::cin >> a >> b >> c; std::cout << is_right_triangle(a, b, c) ? "YES\n" : "NO\n"; } return 0; }
#include <iostream> inline bool is_right_triangle(const u_int a, const u_int b, const u_int c) { return (a * a == b * b + c * c || b * b == c * c + a * a || c * c == a * a + b * b); } int main(void) { u_int n, a, b, c; std::cin >> n; for (u_int i = 0; i < n; ++i) { std::cin >> a >> b >> c; std::cout << (is_right_triangle(a, b, c) ? "YES\n" : "NO\n"); } return 0; }
[["+", 8, 9, 0, 1, 0, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 1, 0, 16, 12, 23, 0, 25]]
1
133
#include <algorithm> #include <iostream> using namespace std; int main() { int N; cin >> N; while (N--) { int i[3], c; int max; cin >> i[0] >> i[1] >> i[2]; sort(i, i + 2); if (i[0] * i[0] + i[1] * i[1] == i[2] * i[2]) cout << "YES\n"; else cout << "NO\n"; } }
#include <algorithm> #include <iostream> using namespace std; int main() { int N; cin >> N; while (N--) { int i[3], c; int max; cin >> i[0] >> i[1] >> i[2]; sort(i, i + 3); if (i[0] * i[0] + i[1] * i[1] == i[2] * i[2]) cout << "YES\n"; else cout << "NO\n"; } }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
112
n = gets while line = gets a = Array.new(3) { |i| } a[0], a[1], a[2] = line.split.map(&:to_i) a.sort if a[2]**2 == a[1]**2 + a[0]**2 puts 'YES' else puts 'NO' end end
n = gets while line = gets a = Array.new(3) { |i| } a[0], a[1], a[2] = line.split.map(&:to_i) a = a.sort if a[2]**2 == a[1]**2 + a[0]**2 puts 'YES' else puts 'NO' end end
[["+", 0, 493, 0, 89, 8, 170, 0, 662, 0, 32], ["+", 0, 89, 8, 170, 0, 662, 12, 652, 486, 22]]
4
79
num = [] (0...gets.to_i).each do |_i| a = gets num = a.split(nil) num.collect!(&:to_i) num.sort! if num[2]**2 == num[0]**2 + num[1]**2 puts 'Yes' else puts 'No' end end
num = [] (0...gets.to_i).each do |_i| a = gets num = a.split(nil) num.collect!(&:to_i) num.sort! if num[2]**2 == (num[0]**2) + (num[1]**2) puts 'YES' else puts 'NO' end end
[["+", 0, 121, 15, 738, 12, 738, 31, 739, 0, 24], ["+", 0, 121, 15, 738, 12, 738, 31, 739, 0, 25], ["+", 0, 121, 15, 738, 12, 738, 12, 739, 0, 24], ["+", 0, 121, 15, 738, 12, 738, 12, 739, 0, 25], ["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6]]
4
70
n = gets.to_i n.times do a, b, c = gets.split.map(&:to_i).sort if c**2 == b**2 + c**2 puts 'YES' else puts 'NO' end end
n = gets.to_i n.times do a, b, c = gets.split.map(&:to_i).sort if c**2 == b**2 + a**2 puts 'YES' else puts 'NO' end end
[["-", 0, 121, 15, 738, 12, 738, 12, 738, 31, 22], ["+", 0, 121, 15, 738, 12, 738, 12, 738, 31, 22]]
4
49
dataset_count = $stdin.gets.to_i dataset_count.times do |_i| point = $stdin.gets.split(' ') point.map!(&:to_i) a, b, c = point if a**2 + b**2 == c**2 puts 'YES' else puts 'NO' end end
dataset_count = $stdin.gets.to_i dataset_count.times do |_i| point = $stdin.gets.split(' ') point.map!(&:to_i) a, b, c = point.sort if a**2 + b**2 == c**2 puts 'YES' else puts 'NO' end end
[["+", 196, 737, 8, 736, 0, 662, 12, 652, 17, 131], ["+", 196, 737, 8, 736, 0, 662, 12, 652, 735, 22]]
4
63
num = gets.split.length (1..num).each do |_i| abc = gets.split.map(&:to_i) abc.sort! if abc[0]**2 + abc[1]**2 == abc[2]**2 puts('YES') else puts('NO') end end
num = gets.to_i (1..num).each do |_i| abc = gets.split.map(&:to_i) abc.sort! if abc[0]**2 + abc[1]**2 == abc[2]**2 puts('YES') else puts('NO') end end
[["-", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["-", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
68
require 'English' gets while gets a, b, c = $LAST_READ_LINE.split.map(&:to_i) puts a * a + b * b == c * c ? 'YES' : 'NO' end
require 'English' gets while gets a, b, c = $LAST_READ_LINE.split.map(&:to_i).sort puts a * a + b * b == c * c ? 'YES' : 'NO' end
[["+", 0, 89, 8, 170, 0, 662, 12, 652, 17, 131], ["+", 0, 89, 8, 170, 0, 662, 12, 652, 735, 22]]
4
43
n = gets.chomp.to_i n.times do i = gets a, b, c = i.chomp a = a.to_i b = b.to_i c = c.to_i if a**2 == (b**2 + c**2) || b**2 == (a**2 + c**2) || c**2 == (a**2 + b**2) puts 'YES' else puts 'NO' end end
n = gets.chomp.to_i n.times do i = gets a, b, c = i.chomp.split a = a.to_i b = b.to_i c = c.to_i if a**2 == (b**2 + c**2) || b**2 == (a**2 + c**2) || c**2 == (a**2 + b**2) puts 'YES' else puts 'NO' end end
[["+", 196, 737, 8, 736, 0, 662, 12, 652, 17, 131], ["+", 196, 737, 8, 736, 0, 662, 12, 652, 735, 22]]
4
91
gets ARGF.each_line do |line| a, b, c = line.split.map(&:to_i) if (a**2 + b**2) == c**2 puts 'YES' else puts 'NO' end end
gets ARGF.each_line do |line| a, b, c = line.split.map(&:to_i).sort if (a**2 + b**2) == c**2 puts 'YES' else puts 'NO' end end
[["+", 196, 737, 8, 736, 0, 662, 12, 652, 17, 131], ["+", 196, 737, 8, 736, 0, 662, 12, 652, 735, 22]]
4
48
# Is it a Right Triangle? ARGF.gets # skip while line = ARGF.gets a, b, c = line.aplit.map(&:to_i).sort res = (a**2) + (b**2) == c**2 puts res ? 'YES' : 'NO' end
# Is it a Right Triangle? ARGF.gets # skip while line = ARGF.gets a, b, c = line.split.map(&:to_i).sort res = (a**2) + (b**2) == c**2 puts res ? 'YES' : 'NO' end
[["-", 0, 662, 12, 652, 486, 652, 486, 652, 735, 22], ["+", 0, 662, 12, 652, 486, 652, 486, 652, 735, 22]]
4
56
gets.chomp.to_i.times do a, b, c = gets.split.map(&:to_i).sort if c**2 == a**2 + b**2 puts 'Yes' else puts 'No' end end
gets.chomp.to_i.times do a, b, c = gets.split.map(&:to_i).sort if c**2 == a**2 + b**2 puts 'YES' else puts 'NO' end end
[["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6]]
4
48
num = gets (1..(num.to_i)).each do |_j| data = gets puts data triangle = data.split(' ').map(&:to_i).sort if triangle[0]**2 + triangle[1]**2 == triangle[2]**2 puts 'YES' else puts 'NO' end end
num = gets (1..(num.to_i)).each do |_j| data = gets triangle = data.split(' ').map(&:to_i).sort if triangle[0]**2 + triangle[1]**2 == triangle[2]**2 puts 'YES' else puts 'NO' end end
[["-", 0, 652, 196, 737, 8, 736, 0, 652, 735, 22], ["-", 196, 737, 8, 736, 0, 652, 3, 4, 0, 22]]
4
73
inputArray = [] rows = gets.to_i i = 0 rows.times do temp = gets inputArray[i], inputArray[i + 1], inputArray[i + 2] = temp.split(' ').map(&:to_i) i += 3 end i = 0 inputArray.map! { |n| n**2 } test = [] rows.times do test = [inputArray[i], inputArray[i + 1], inputArray[i + 2]] test.sort! if test[0] + test[1] == test[i + 2] puts 'YES' else puts 'NO' end i += 3 end
inputArray = [] rows = gets.to_i i = 0 rows.times do temp = gets inputArray[i], inputArray[i + 1], inputArray[i + 2] = temp.split(' ').map(&:to_i) i += 3 end i = 0 inputArray.map! { |n| n**2 } test = [] rows.times do test = [inputArray[i], inputArray[i + 1], inputArray[i + 2]] test.sort! if test[0] + test[1] == test[2] puts 'YES' else puts 'NO' end i += 3 end
[["-", 0, 121, 15, 738, 12, 742, 0, 738, 31, 22], ["-", 0, 121, 15, 738, 12, 742, 0, 738, 17, 72]]
4
134
cnt = gets.to_i ss = [] cnt.times do |_i| ss = gets.to_s.split(' ').map(&:to_i) if (ss[0] * ss[0] + ss[1] * ss[1] - ss[2] * ss[2]).zero? || (ss[0] * ss[0] - ss[1] * ss[1] + ss[2] * ss[2]).zero? || (-ss[0] * ss[0] + ss[1] * ss[1] + ss[2] * ss[2]).zero? p 'YES' else p 'NO' end end
cnt = gets.to_i ss = [] cnt.times do |_i| ss = gets.to_s.split(' ').map(&:to_i) if (ss[0] * ss[0] + ss[1] * ss[1] - ss[2] * ss[2]).zero? || (ss[0] * ss[0] - ss[1] * ss[1] + ss[2] * ss[2]).zero? || (-ss[0] * ss[0] + ss[1] * ss[1] + ss[2] * ss[2]).zero? puts 'YES' else puts 'NO' end end
[["-", 8, 736, 0, 121, 64, 749, 0, 652, 735, 22], ["+", 8, 736, 0, 121, 64, 749, 0, 652, 735, 22], ["-", 8, 736, 0, 121, 75, 95, 0, 652, 735, 22], ["+", 8, 736, 0, 121, 75, 95, 0, 652, 735, 22]]
4
148
num = [] i = 0 roop = gets.to_i while i < roop a = gets num = [] num = a.split(nil) num = num.map(&:to_i) num.sort! if (num[2]**2) == ((num[1]**2) + (num[0]**2)) puts 'yes' else puts 'no' end i += 1 end
num = [] i = 0 roop = gets.to_i while i < roop a = gets num = [] num = a.split(nil) num = num.map(&:to_i) num.sort! if (num[2]**2) == ((num[1]**2) + (num[0]**2)) puts 'YES' else puts 'NO' end i += 1 end
[["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6]]
4
86
while str = gets array = str.chomp.split(' ').map(&:to_i) array = array.sort if array[2] * array[2] == array[1] * array[1] + array[0] * array[0] puts 'YES' else puts 'NO' end end
gets while str = gets array = str.chomp.split(' ').map(&:to_i) array = array.sort if array[2] * array[2] == array[1] * array[1] + array[0] * array[0] puts 'YES' else puts 'NO' end end
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 22]]
4
68
n = gets.to_i n.times do input = gets.split(' ') a = input[0].to_i b = input[1].to_i c = input[2].to_i a **= 2 b **= 2 c **= 2 if a = b + c || b = a + c || c = a + b puts 'yes' else puts 'no' end end
n = gets.to_i n.times do input = gets.split(' ') a = input[0].to_i b = input[1].to_i c = input[2].to_i a **= 2 b **= 2 c **= 2 if a == b + c || b == a + c || c == a + b puts 'YES' else puts 'NO' end end
[["-", 196, 737, 8, 736, 0, 121, 15, 662, 0, 32], ["+", 0, 121, 15, 738, 31, 738, 31, 738, 17, 60], ["-", 0, 121, 15, 662, 12, 738, 12, 662, 0, 32], ["+", 0, 121, 15, 738, 31, 738, 12, 738, 17, 60], ["-", 12, 738, 12, 662, 12, 738, 12, 662, 0, 32], ["+", 8, 736, 0, 121, 15, 738, 12, 738, 17, 60], ["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6]]
4
81
if __FILE__ == $PROGRAM_NAME n = gets.to_i n.times do args = gets.split(' ').map(&:to_i) result = (((args[0]**2) + (args[1]**2)) == args[2]**2) if result puts 'YES' else puts 'NO' end end end
if __FILE__ == $PROGRAM_NAME n = gets.to_i n.times do args = gets.split(' ').map(&:to_i).sort result = (((args[0]**2) + (args[1]**2)) == args[2]**2) if result puts 'YES' else puts 'NO' end end end
[["+", 196, 737, 8, 736, 0, 662, 12, 652, 17, 131], ["+", 196, 737, 8, 736, 0, 662, 12, 652, 735, 22]]
4
73
#!/usr/local/bin/ruby a = [] N = gets.to_i N.times do a << gets.split(' ').map(&:to_i) end a.each do |x, y, z| if z**2 == x**2 + y**2 puts 'YES' else puts 'NO' end end
#!/usr/local/bin/ruby a = [] N = gets.to_i N.times do a << gets.split(' ').map(&:to_i).sort end a.each do |x, y, z| if z**2 == x**2 + y**2 puts 'YES' else puts 'NO' end end
[["+", 196, 737, 8, 736, 0, 738, 12, 652, 17, 131], ["+", 196, 737, 8, 736, 0, 738, 12, 652, 735, 22]]
4
65
n = gets.chomp.to_i n.times do |_i| a = gets break if a.nil? b = a.split(' ') b.map!(&:to_i) b.sort! if (b[2]**2) == (b[1]**2) + (b[0]**2) p 'YES' else p 'NO' end end
n = gets.chomp.to_i n.times do |_i| a = gets break if a.nil? b = a.split(' ') b.map!(&:to_i) b.sort! if (b[2]**2) == (b[1]**2) + (b[0]**2) puts 'YES' else puts 'NO' end end
[["-", 8, 736, 0, 121, 64, 749, 0, 652, 735, 22], ["+", 8, 736, 0, 121, 64, 749, 0, 652, 735, 22], ["-", 8, 736, 0, 121, 75, 95, 0, 652, 735, 22], ["+", 8, 736, 0, 121, 75, 95, 0, 652, 735, 22]]
4
80
count = $stdin.gets.chomp.to_i while count != 0 sannpenn = $stdin.gets.chomp.split("\s") sannpenn.map!(&:to_i).sort count += -1 if (sannpenn[0]**2 + sannpenn[1]**2) == sannpenn[2]**2 puts 'YES' else puts 'NO' end end
count = $stdin.gets.chomp.to_i while count != 0 sannpenn = $stdin.gets.chomp.split("\s") sannpenn.map!(&:to_i) sannpenn.sort! count += -1 if (sannpenn[0]**2 + sannpenn[1]**2) == sannpenn[2]**2 puts 'YES' else puts 'NO' end end
[["+", 0, 493, 0, 89, 8, 170, 0, 652, 486, 22], ["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["+", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22]]
4
74
n=int(input()) for i in range(n): p=list(map(int,input().split())) p.sort() a=x[0] b=x[1] c=x[2] if a*a+b*b==c*c: print('YES') else: print('NO')
n=int(input()) for i in range(n): p=list(map(int,input().split())) p.sort() a=p[0] b=p[1] c=p[2] if a*a+b*b==c*c: print('YES') else: print('NO')
[["-", 8, 196, 0, 1, 0, 662, 12, 206, 51, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 51, 22]]
5
83
n=int(input()) for i in range(n): a,b,c = input().split() x = int(a) y = int(b) z = int(c) p = [a,b,c] p.sort() if pow(p[0],2) + pow(p[1],2) == pow(p[2],2): print('YES') else: print('NO')
n=int(input()) for i in range(n): a,b,c = input().split() x = int(a) y = int(b) z = int(c) p = [x,y,z] p.sort() if pow(p[0],2) + pow(p[1],2) == pow(p[2],2): print('YES') else: print('NO')
[["-", 8, 196, 0, 1, 0, 662, 12, 634, 0, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 634, 0, 22]]
5
106
for i in range(int(input())): values = sorted(map(lambda x: int(x)^2, input().split(' '))) if values[2] == values[1] + values[0]: print('YES') else: print('NO')
# -*- coding: utf-8 -*- for i in range(int(input())): values = sorted(map(lambda x: int(x)**2, input().split(' '))) if values[2] == values[1] + values[0]: print("YES") else: print("NO")
[["-", 0, 652, 3, 4, 0, 670, 8, 657, 17, 140], ["+", 0, 652, 3, 4, 0, 670, 8, 657, 17, 578], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
71
n = int(input()) for i in range(n): x, y, z =map(int, input().split()) if x*x + y*y == z*z or y*y + z*z == x*x or x*x + z*z == y*y : print("Yes") else: print("No")
n = int(input()) for i in range(n): x, y, z =map(int, input().split()) if x*x + y*y == z*z or y*y + z*z == x*x or x*x + z*z == y*y : print("YES") else: print("NO")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
85
#!/usr/bin/python #-coding:utf-8- import sys data_list = [] for s in sys.stdin: data_list.append( list(map(int,s.split())) ) print(data_list) for e in data_list[1:]: e.sort() if e[0]*e[0] + e[1]*e[1] == e[2] * e[2]: print("YES") else: print("NO")
#!/usr/bin/python #-coding:utf-8- import sys data_list = [] for s in sys.stdin: data_list.append( list(map(int,s.split())) ) for e in data_list[1:]: e.sort() if e[0]*e[0] + e[1]*e[1] == e[2] * e[2]: print("YES") else: print("NO")
[["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
96
def check_right_triangle(side1, side2, side3): pow = 2 if side1**pow == side2**pow + side3**pow: return True if side2**pow == side3**pow + side1**pow: return True if side3**pow == side1**pow + side2**pow: return True return False def check(): for i in range(int(input())): sides = list(map(int, input().split())) if check_right_triangle(sides[0], sides[1], sides[2]): print("YES") print("NO") if __name__ == "__main__": check() # print check_right_triangle(3, 4, 5)
def check_right_triangle(side1, side2, side3): pow = 2 if side1**pow == side2**pow + side3**pow: return True if side2**pow == side3**pow + side1**pow: return True if side3**pow == side1**pow + side2**pow: return True return False def check(): for i in range(int(input())): sides = list(map(int, input().split())) if check_right_triangle(sides[0], sides[1], sides[2]): print("YES") else: print("NO") if __name__ == "__main__": check() # print check_right_triangle(4, 3, 5) # print check_right_triangle(4, 3, 6) # print check_right_triangle(8, 8, 8)
[["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102]]
5
137
n = int(input()) for k in range(n): [a,b,c] = list(map(int,input().split())) a,b,c = sorted([a,b,c]) if a**2 + b**2 == c**2: print("YES") else: print("No")
n = int(input()) for k in range(n): [a,b,c] = list(map(int,input().split())) a,b,c = sorted([a,b,c]) if a**2 + b**2 == c**2: print("YES") else: print("NO")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
82
#!/usr/bin/env python # -*- coding: utf-8 -*- n = int(input()) for i in range(n): x = list(map(int, input().split())) x.sort() if x[0]**2 + x[1]**2 == x[2]**2: print('Yes') else: print('No')
#!/usr/bin/env python # -*- coding: utf-8 -*- n = int(input()) for i in range(n): x = list(map(int, input().split())) x.sort() if x[0]**2 + x[1]**2 == x[2]**2: print('YES') else: print('NO')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
76
N = int(input()) for i in range(N): a = list(range(3)) a[0],a[1],a[2] = list(map(int, input().split())) a.sort() if a[0]^2 + a[1]^2 == a[2]^2: print("YES") else: print("NO")
N = int(input()) for i in range(N): a = list(range(3)) a[0],a[1],a[2] = list(map(int, input().split())) a.sort() if a[0]**2 + a[1]**2 == a[2]**2: print("YES") else: print("NO")
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 17, 140], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 17, 578], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 140], ["+", 0, 57, 15, 666, 0, 657, 12, 657, 17, 578], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 578]]
5
96
import math def main(): data = [] while 1: try: n = input().split() a = int(n[0]) b = int(n[1]) ans = int(math.log10(a+b)+1) data.append(ans) except IndexError: #EOF break for i in data: print(i) if __name__ == "__main__": main()
import math def main(): data = [] while 1: try: n = input().split() a = int(n[0]) b = int(n[1]) ans = int(math.log10(a+b)+1) data.append(ans) except EOFError: break for i in data: print(i) if __name__ == "__main__": main()
[["-", 0, 52, 8, 196, 0, 246, 0, 671, 0, 22], ["+", 0, 52, 8, 196, 0, 246, 0, 671, 0, 22]]
5
88
import sys import math for line in sys.stdin: a, b = [int(i) for i in line.split()] print(int(math.log10(a * b) + 1))
import sys import math for line in sys.stdin: try: a, b = [int(i) for i in line.split()] print(int(math.log10(a + b) + 1)) except: break
[["+", 0, 656, 0, 7, 8, 196, 0, 246, 0, 247], ["+", 0, 656, 0, 7, 8, 196, 0, 246, 0, 102], ["-", 0, 657, 31, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 657, 31, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 8, 196, 0, 246, 0, 671, 0, 672], ["+", 0, 7, 8, 196, 0, 246, 0, 671, 0, 102], ["+", 0, 246, 0, 671, 0, 196, 0, 93, 0, 94]]
5
45
def main(): while True: try: a, b = (int(x) for x in input().split()) print(len(str(a+b))) except EOFError: break
def main(): while True: try: a, b = (int(x) for x in input().split()) print(len(str(a+b))) except EOFError: break main()
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
46
while True: try: a, b = (int(x) for x in input().split()) print(a + b) except: break;
while True: try: a, b = (int(x) for x in input().split()) print(len(str(a + b))) except: break;
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
35
import sys, math def run(): N = [] for n in sys.stdin: a,b = map(int, n.split()) N.append((a,b)) for a,b in N: print(math.ceil(math.log10(a+b))) if __name__ == '__main__': run()
import sys, math def run(): N = [] for n in sys.stdin: a,b = map(int, n.split()) N.append((a,b)) for a,b in N: print(math.floor(math.log10(a+b)) + 1) if __name__ == '__main__': run()
[["-", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 3, 4, 0, 657, 31, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
77
import sys print("\n".join([len(str(sum([int(x) for x in l.split(' ')]))) for l in sys.stdin]))
import sys print("\n".join(str(len(str(sum(int(x) for x in l.split(' '))))) for l in sys.stdin))
[["-", 3, 4, 0, 652, 3, 4, 0, 658, 0, 70], ["+", 3, 4, 0, 652, 3, 668, 8, 652, 63, 22], ["+", 0, 652, 3, 668, 8, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 652, 3, 4, 0, 658, 0, 73], ["+", 0, 652, 3, 668, 8, 652, 3, 4, 0, 25]]
5
46
while True: try: a, b = [int(i) for i in input().split()] print(a + b) except EOFError: break
while True: try: a, b = [int(i) for i in input().split()] print(len(str(a + b))) except EOFError: break
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
35
try: a, b = list(map(int,input().split())) print(len(str(a+b))) except: pass
try: while True: a, b = list(map(int,input().split())) print(len(str(a+b))) except: pass
[["+", 0, 656, 0, 246, 8, 196, 0, 52, 0, 89], ["+", 0, 656, 0, 246, 8, 196, 0, 52, 15, 146], ["+", 0, 656, 0, 246, 8, 196, 0, 52, 0, 102]]
5
36
# -*- coding: utf-8 -*- for line in sys.stdin.readlines(): a, b = list(map(int, line.strip().split())) n = a + b ans = 1 while(n >= 10): n /= 10 ans += 1 print(ans)
# -*- coding: utf-8 -*- import sys for line in sys.stdin.readlines(): a, b = list(map(int, line.strip().split())) n = a + b ans = 1 while(n >= 10): n /= 10 ans += 1 print(ans)
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
58
import sys for jk in sys.stdin: j,k=list(map(int,jk.split())) print(len(j+k))
import sys for jk in sys.stdin: j,k=list(map(int,jk.split())) print(len(str(j+k)))
[["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
35
while True: try: a,b = map(int,input().split(" ")) print(a+b) except: break
while True: try: a,b = map(int,input().split(" ")) print(len(str(a+b))) except: break
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
33
while True: try: line = input() except: break a, b = map(int, input().strip().split()) print(len(str(a + b)))
while True: try: line = input() except: break a, b = map(int, line.strip().split()) print(len(str(a + b)))
[["-", 63, 319, 500, 652, 63, 319, 500, 652, 63, 22], ["-", 500, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["-", 500, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["+", 0, 652, 63, 319, 500, 652, 63, 319, 500, 22]]
5
45
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var Arr = (input.trim()).split("\n"); Arr.shift(); Arr.forEach(function(v) { var arr = v.split(" ").map(Number); arr.sort(function(a, b) { return b - a; }); var a = arr[0]; var b = arr[1]; var c = arr[2]; var str = ""; str = (c * c == a * a + b * b) ? "YES" : "NO"; console.log(str); });
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var Arr = (input.trim()).split("\n"); Arr.shift(); Arr.forEach(function(v) { var arr = v.split(" ").map(Number); arr.sort(function(a, b) { return a - b; }); var a = arr[0]; var b = arr[1]; var c = arr[2]; var str = ""; str = (c * c == a * a + b * b) ? "YES" : "NO"; console.log(str); });
[["-", 0, 63, 8, 556, 0, 37, 0, 16, 31, 22], ["-", 0, 63, 8, 556, 0, 37, 0, 16, 17, 33], ["+", 0, 63, 8, 556, 0, 37, 0, 16, 17, 33], ["+", 0, 63, 8, 556, 0, 37, 0, 16, 12, 22]]
2
154
process.stdin .on("data", function(c) { (c + "").trim().split("\n").some(function(a) { var n = a.split(" ") .map(function(x) { return x * x }) .sort(function(x, y) { return x - y }); console.log(n[0] + n[1] === n[2] ? 'YES' : 'NO'); }); }) .resume();
process.stdin .on("data", function(c) { (c + "").trim().split("\n").slice(1).some(function(a) { var n = a.split(" ") .map(function(x) { return x * x }) .sort(function(x, y) { return x - y }); console.log(n[0] + n[1] === n[2] ? 'YES' : 'NO'); }); }) .resume();
[["+", 0, 2, 63, 558, 500, 2, 63, 558, 559, 560], ["+", 0, 2, 63, 558, 500, 2, 3, 3, 0, 24], ["+", 0, 2, 63, 558, 500, 2, 3, 3, 0, 555], ["+", 0, 2, 63, 558, 500, 2, 3, 3, 0, 25], ["+", 8, 556, 0, 1, 0, 2, 63, 558, 0, 131]]
2
120
<?php $n = trim(fgets(STDIN)); for ($i = 0; $i < $n; $i++) { $stdin = explode(" ", trim(fgets(STDIN))); asort($stdin); //var_dump($stdin); if($stdin[0]*$stdin[0] + $stdin[1]*$stdin[1] == $stdin[2]*$stdin[2]){ echo "YES". PHP_EOL; }else{ echo "NO". PHP_EOL; } }
<?php $n = trim(fgets(STDIN)); for ($i = 0; $i < $n; $i++) { $stdin = explode(' ', trim(fgets(STDIN))); sort($stdin); //var_dump($stdin); if($stdin[0]*$stdin[0] + $stdin[1]*$stdin[1] == $stdin[2]*$stdin[2]){ echo "YES". PHP_EOL; }else{ echo "NO". PHP_EOL; } }
[["-", 12, 613, 3, 3, 0, 28, 0, 609, 0, 62], ["+", 12, 613, 3, 3, 0, 28, 0, 557, 0, 104], ["-", 0, 7, 0, 9, 0, 1, 0, 613, 63, 141], ["+", 0, 7, 0, 9, 0, 1, 0, 613, 63, 141]]
6
113
<?php $rest=trim(fgets(STDIN)); while(!$line=fgets(STDIN)){ $num[]=trim($line); } foreach($num as $ele2){ $trinum=explode(" ",$ele2); $maxnum=max($trinum); $key=array_search($maxnum,$trinum); unset($trinum[$key]); $sum=0; foreach($trinum as $ele){ $sum+=pow($ele,2); } /* echo "max:".(int)$maxnum; */ if($sum==pow((int)$maxnum,2)) echo "YES\n"; else echo "NO\n"; }
<?php $rest=fgets(STDIN); while($line=fgets(STDIN)){ $num[]=trim($line); } foreach($num as $ele2){ $trinum=explode(" ",$ele2); $maxnum=max($trinum); $key=array_search($maxnum,$trinum); unset($trinum[$key]); $sum=0; foreach($trinum as $ele){ $sum+=pow($ele,2); } /* echo "max:".(int)$maxnum; */ if($sum==pow((int)$maxnum,2)) echo "YES\n"; else echo "NO\n"; }
[["-", 0, 493, 0, 1, 0, 11, 12, 613, 63, 141], ["-", 0, 1, 0, 11, 12, 613, 3, 3, 0, 24], ["-", 3, 3, 0, 28, 0, 613, 3, 3, 0, 25], ["-", 0, 493, 0, 52, 15, 23, 0, 616, 0, 111]]
6
146
<?php $n=trim(fgets(STDIN)); for($i=0;$i<$n;$i++){ list($a,$b,$c)=explode(' ',trim(fgets(STDIN))); if($b<$a){$d=$a;$a=$b;$b=$d;} if($c<$b){$d=$b;$b=$c;$c=$d;} $e=$a*$a+$b*$b-$c*c; echo (!$e)?'YES':'NO',PHP_EOL; }
<?php $n=trim(fgets(STDIN)); for($i=0;$i<$n;$i++){ list($a,$b,$c)=explode(' ',trim(fgets(STDIN))); if($b<$a){$d=$a;$a=$b;$b=$d;} if($c<$b){$d=$b;$b=$c;$c=$d;} $e=$a*$a+$b*$b-$c*$c; echo (!$e)?'YES':'NO',PHP_EOL; }
[["+", 0, 11, 12, 16, 12, 16, 12, 606, 0, 607]]
6
151
<?php fscanf( STDIN, "%d", $count ); for($i=0;$i<$count;$i++){ fscanf( STDIN, "%d %d %d", $a, $b, $c ); if( $b < $a ) list( $b, $a ) = [ $a, $b ];#a,b??§?????§???b if( $c < $b ) list( $c, $b ) = [ $b, $c ];#a,b,c??§?????§???c $answer = ( $a * $a + $b * $b == $b * $b ) ? 'YES' : 'NO'; printf("%s\n",$answer); } ?>
<?php fscanf( STDIN, "%d", $count ); for($i=0;$i<$count;$i++){ fscanf( STDIN, "%d %d %d", $a, $b, $c ); if( $b < $a ) list( $b, $a ) = [ $a, $b ];#a,b??§?????§???b if( $c < $b ) list( $c, $b ) = [ $b, $c ];#a,b,c??§?????§???c $answer = ( $a * $a + $b * $b == $c * $c ) ? 'YES' : 'NO'; printf("%s\n",$answer); }
[["-", 15, 23, 0, 16, 12, 16, 31, 606, 0, 141], ["+", 15, 23, 0, 16, 12, 16, 31, 606, 0, 141], ["-", 15, 23, 0, 16, 12, 16, 12, 606, 0, 141], ["+", 15, 23, 0, 16, 12, 16, 12, 606, 0, 141], ["-", 36, 36, 36, 36, 36, 36, 0, 493, 0, 611]]
6
145
fscanf(STDIN, "%d", $count); for( $i = 0; $i < $count; $i++){ fscanf(STDIN, "%d %d %d", $data[0], $data[1], $data[2]); rsort($data); $long = $data[0]*$data[0]; $other = $data[1]*$data[1] + $data[2]*$data[2]; if($long == $other){ echo "YES\n"; } else{ echo "NO\n"; } }
<?php fscanf(STDIN, "%d", $count); for( $i = 0; $i < $count; $i++){ fscanf(STDIN, "%d %d %d", $data[0], $data[1], $data[2]); rsort($data); $long = $data[0]*$data[0]; $other = $data[1]*$data[1] + $data[2]*$data[2]; if($long == $other){ echo "YES\n"; } else{ echo "NO\n"; } }
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]]
6
131
import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] a) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] inputs = new int[3]; String result; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { int m = s.nextInt(); inputs[j] = m * m; } Arrays.sort(inputs); result = inputs[0] + inputs[1] == inputs[2] ? "Yes" : "No"; System.out.println(result); } } }
import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] a) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] inputs = new int[3]; String result; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { int m = s.nextInt(); inputs[j] = m * m; } Arrays.sort(inputs); result = inputs[0] + inputs[1] == inputs[2] ? "YES" : "NO"; System.out.println(result); } } }
[["-", 0, 1, 0, 11, 12, 510, 64, 5, 0, 491], ["+", 0, 1, 0, 11, 12, 510, 64, 5, 0, 491], ["-", 0, 1, 0, 11, 12, 510, 75, 5, 0, 491], ["+", 0, 1, 0, 11, 12, 510, 75, 5, 0, 491]]
3
155
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] data = new int[3]; while (scan.hasNext()) { int n = scan.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { data[j] = scan.nextInt(); } for (int j = 0; j < 2; j++) { for (int k = j + 1; k < 3; k++) { if (data[i] < data[k]) { int tmp; tmp = data[i]; data[i] = data[k]; data[k] = tmp; } } } if (data[0] * data[0] == data[1] * data[1] + data[2] * data[2]) System.out.println("YES"); else System.out.println("NO"); } } } }
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] data = new int[3]; while (scan.hasNext()) { int n = scan.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { data[j] = scan.nextInt(); } for (int j = 0; j < 2; j++) { for (int k = j + 1; k < 3; k++) { if (data[j] < data[k]) { int tmp; tmp = data[j]; data[j] = data[k]; data[k] = tmp; } } } if (data[0] * data[0] == data[1] * data[1] + data[2] * data[2]) System.out.println("YES"); else System.out.println("NO"); } } } }
[["-", 0, 57, 15, 15, 0, 16, 31, 504, 71, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 71, 22], ["-", 64, 196, 0, 1, 0, 11, 12, 504, 71, 22], ["+", 64, 196, 0, 1, 0, 11, 12, 504, 71, 22], ["-", 64, 196, 0, 1, 0, 11, 31, 504, 71, 22], ["+", 64, 196, 0, 1, 0, 11, 31, 504, 71, 22]]
3
237
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Queue; import java.util.Scanner; import java.util.Stack; /** * @author yoshikyoto */ class Main { static final boolean DEBUG = false; static Scanner sc = new Scanner(new InputStreamReader(System.in)); static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String args[]) throws Exception { int n = readInt(); for (int i = 0; i < n; i++) { int t[] = parseInt(readLine().split(" ")); sort(t); t[0] *= t[0]; t[1] *= t[1]; t[2] *= t[2]; if (t[0] + t[1] == t[2]) { p("YES"); } else { p("NO"); } } } public static String readLine() throws IOException { return br.readLine(); } public static int readInt() { return sc.nextInt(); } public static void pa(Object[] arr) { System.out.println(Arrays.toString(arr)); } public static void pa(int[] arr) { System.out.println(Arrays.toString(arr)); } public static void pa(double[] arr) { System.out.println(Arrays.toString(arr)); } public static void pa(boolean[] arr) { System.out.println(Arrays.toString(arr)); } public static void p(Object o) { System.out.println(o.toString()); } public static void d(Object o) { if (DEBUG) System.out.println(o.toString()); } public static void da(int[] arr) { if (DEBUG) System.out.println(Arrays.toString(arr)); } public static void sort(int[] a) { Arrays.sort(a); } public static int[] parseInt(String[] arr) { int[] res = new int[arr.length]; for (int i = 0; i < arr.length; i++) res[i] = Integer.parseInt(arr[i]); return res; } public static int parseInt(Object o) { return Integer.parseInt(o.toString()); } public static int digit(int n) { return String.valueOf(n).length(); } } class MyHashMap<E> extends HashMap<E, Integer> { ArrayList<E> keyArray = new ArrayList<E>(); public void add(E key) { add(key, 1); } public void add(E key, Integer value) { if (containsKey(key)) { value += get(key); } else { keyArray.add(key); } put(key, value); } }
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Queue; import java.util.Scanner; import java.util.Stack; /** * @author yoshikyoto */ class Main { static final boolean DEBUG = false; static Scanner sc = new Scanner(new InputStreamReader(System.in)); static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String args[]) throws Exception { int n = parseInt(readLine()); for (int i = 0; i < n; i++) { int t[] = parseInt(readLine().split(" ")); Arrays.sort(t); t[0] *= t[0]; t[1] *= t[1]; t[2] *= t[2]; if (t[0] + t[1] == t[2]) { p("YES"); } else { p("NO"); } } } public static String readLine() throws IOException { return br.readLine(); } public static int readInt() { return sc.nextInt(); } public static void pa(Object[] arr) { System.out.println(Arrays.toString(arr)); } public static void pa(int[] arr) { System.out.println(Arrays.toString(arr)); } public static void pa(double[] arr) { System.out.println(Arrays.toString(arr)); } public static void pa(boolean[] arr) { System.out.println(Arrays.toString(arr)); } public static void p(Object o) { System.out.println(o.toString()); } public static void d(Object o) { if (DEBUG) System.out.println(o.toString()); } public static void da(int[] arr) { if (DEBUG) System.out.println(Arrays.toString(arr)); } public static void sort(int[] a) { Arrays.sort(a); } public static int[] parseInt(String[] arr) { int[] res = new int[arr.length]; for (int i = 0; i < arr.length; i++) res[i] = Integer.parseInt(arr[i]); return res; } public static int parseInt(Object o) { return Integer.parseInt(o.toString()); } public static int digit(int n) { return String.valueOf(n).length(); } } class MyHashMap<E> extends HashMap<E, Integer> { ArrayList<E> keyArray = new ArrayList<E>(); public void add(E key) { add(key, 1); } public void add(E key, Integer value) { if (containsKey(key)) { value += get(key); } else { keyArray.add(key); } put(key, value); } }
[["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 49, 200, 51, 492, 3, 4, 0, 492, 141, 22], ["+", 51, 492, 3, 4, 0, 492, 3, 4, 0, 24], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 25], ["+", 0, 7, 8, 196, 0, 1, 0, 492, 500, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 492, 0, 131]]
3
684
import java.util.Scanner; public class Main { void run() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int a, b, c; for (int i = 0; i < N; i++) { a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); a = a * a; b = b * b; c = c * c; if (a + b == c) { System.out.println("YES"); } else if (b + c == a) { System.out.println("YES"); } else if (a + c == b) { System.out.println("YES"); } System.out.println("NO"); } } public static void main(String[] args) { new Main().run(); } }
import java.util.Scanner; public class Main { void run() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int a, b, c; for (int i = 0; i < N; i++) { a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); a = a * a; b = b * b; c = c * c; if (a + b == c) { System.out.println("YES"); } else if (b + c == a) { System.out.println("YES"); } else if (a + c == b) { System.out.println("YES"); } else { System.out.println("NO"); } } } public static void main(String[] args) { new Main().run(); } }
[["+", 8, 196, 0, 57, 75, 57, 75, 57, 0, 95], ["+", 0, 57, 75, 57, 75, 57, 75, 196, 0, 45], ["+", 0, 57, 75, 57, 75, 57, 75, 196, 0, 46]]
3
200
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { private StringTokenizer st; private BufferedReader bf; private int w; Main() { readData(); } private void readData() { try { bf = new BufferedReader(new InputStreamReader(System.in)); st = new StringTokenizer(bf.readLine()); int n = nextInt(); int[] a; for (int i = 0; i < n; i++) { a = new int[3]; a[0] = nextInt(); a[1] = nextInt(); a[1] = nextInt(); Arrays.sort(a); if ((a[0] * a[0] + a[1] * a[1]) == a[2] * a[2]) System.out.println("YES"); else System.out.println("NO"); } } catch (Exception e) { e.printStackTrace(); } } private int nextInt() throws IOException { return Integer.parseInt(next()); } private String next() throws IOException { if (st == null || !st.hasMoreTokens()) st = new StringTokenizer(bf.readLine()); return st.nextToken(); } public static void main(String[] args) { // TODO Auto-generated method stub Main m = new Main(); } }
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { private StringTokenizer st; private BufferedReader bf; private int w; Main() { readData(); } private void readData() { try { bf = new BufferedReader(new InputStreamReader(System.in)); st = new StringTokenizer(bf.readLine()); int n = nextInt(); int[] a; for (int i = 0; i < n; i++) { a = new int[3]; a[0] = nextInt(); a[1] = nextInt(); a[2] = nextInt(); Arrays.sort(a); // for(int k: a) // System.out.println(k); if ((a[0] * a[0] + a[1] * a[1]) == a[2] * a[2]) System.out.println("YES"); else System.out.println("NO"); } } catch (Exception e) { e.printStackTrace(); } } private int nextInt() throws IOException { return Integer.parseInt(next()); } private String next() throws IOException { if (st == null || !st.hasMoreTokens()) st = new StringTokenizer(bf.readLine()); return st.nextToken(); } public static void main(String[] args) { // TODO Auto-generated method stub Main m = new Main(); } }
[["-", 8, 196, 0, 1, 0, 11, 31, 504, 71, 499], ["+", 8, 196, 0, 1, 0, 11, 31, 504, 71, 499]]
3
318
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); StringBuilder builder = new StringBuilder(); int a = Integer.parseInt(reader.readLine()); for (int i = 0; i < a; i++) { String[] line = reader.readLine().split(" "); int[] nums = new int[3]; for (int j = 0; j < 3; j++) { nums[j] = Integer.parseInt(line[j]); } Arrays.sort(nums); if (Math.pow(nums[0], 2) + Math.pow(nums[1], 2) == Math.pow(nums[2], 2)) builder.append("Yes\n"); else builder.append("No\n"); } System.out.print(builder); } }
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); StringBuilder builder = new StringBuilder(); int a = Integer.parseInt(reader.readLine()); for (int i = 0; i < a; i++) { String[] line = reader.readLine().split(" "); int[] nums = new int[3]; for (int j = 0; j < 3; j++) { nums[j] = Integer.parseInt(line[j]); } Arrays.sort(nums); if (Math.pow(nums[0], 2) + Math.pow(nums[1], 2) == Math.pow(nums[2], 2)) builder.append("YES\n"); else builder.append("NO\n"); } System.out.print(builder); } }
[["-", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
237
import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; class Main { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); int n = in.nextInt(); for (int i = 0; i < n; i++) { ArrayList<Integer> intArr = new ArrayList<Integer>(); for (int j = 0; j < 3; j++) intArr.add(in.nextInt()); Collections.sort(intArr); Collections.reverse(intArr); int c = intArr.get(0); int a = intArr.get(1); int b = intArr.get(2); if (a * a + b * b == c * c) { System.out.println("YES\n"); } else { System.out.println("NO\n"); } } } }
import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; class Main { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); int n = in.nextInt(); for (int i = 0; i < n; i++) { ArrayList<Integer> intArr = new ArrayList<Integer>(); for (int j = 0; j < 3; j++) intArr.add(in.nextInt()); Collections.sort(intArr); Collections.reverse(intArr); int c = intArr.get(0); int a = intArr.get(1); int b = intArr.get(2); if (a * a + b * b == c * c) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 44]]
3
208
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int i[]; i = new int[3]; for (int count = 0; count < n; count++) { for (int d = 0; d < 3; d++) { i[d] = sc.nextInt(); } Arrays.sort(i); } if ((i[2] * i[2]) == (i[0] * i[0]) + (i[1] * i[1])) { System.out.println("Yes"); } else System.out.println("No"); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int i[]; i = new int[3]; for (int count = 0; count < n; count++) { for (int d = 0; d < 3; d++) { i[d] = sc.nextInt(); } Arrays.sort(i); if ((i[2] * i[2]) == (i[0] * i[0]) + (i[1] * i[1])) { System.out.println("YES"); } else System.out.println("NO"); } } }
[["-", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46], ["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46]]
3
170
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int number = sc.nextInt(); for (int i = 1; i < number; i++) { int[] a = new int[3]; a[0] = sc.nextInt(); a[1] = sc.nextInt(); a[2] = sc.nextInt(); Arrays.sort(a); if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int number = sc.nextInt(); for (int i = 0; i < number; i++) { int[] a = new int[3]; a[0] = sc.nextInt(); a[1] = sc.nextInt(); a[2] = sc.nextInt(); Arrays.sort(a); if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
177
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { // Here your code ! BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for (int i = 0; i < n; i++) { String[] vals = br.readLine().split(",", 0); int[] int_vals = new int[vals.length]; for (int j = 0; j < int_vals.length; j++) { int_vals[j] = Integer.parseInt(vals[j]); } Arrays.sort(int_vals); int a2 = int_vals[2] * int_vals[2]; int b2 = int_vals[1] * int_vals[1]; int c2 = int_vals[0] * int_vals[0]; if (a2 == b2 + c2) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { // Here your code ! BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); // int n = Integer.parseInt("1"); for (int i = 0; i < n; i++) { String[] vals = br.readLine().split(" ", 0); // String[] vals = "4 3 5".split(" ",0); int[] int_vals = new int[vals.length]; for (int j = 0; j < int_vals.length; j++) { int_vals[j] = Integer.parseInt(vals[j]); } Arrays.sort(int_vals); int a2 = int_vals[2] * int_vals[2]; int b2 = int_vals[1] * int_vals[1]; int c2 = int_vals[0] * int_vals[0]; if (a2 == b2 + c2) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
[["-", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491], ["+", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491]]
3
233
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<String> ynJudge = new ArrayList<>(); int N = sc.nextInt(); int sideA, sideB, sideC; int cnt = 0; for (int i = 0; i < N; i++) { sideA = sc.nextInt(); sideB = sc.nextInt(); sideC = sc.nextInt(); if (sideA * sideA == sideB * sideB + sideC * sideC || sideB * sideB == sideA * sideA + sideC * sideC || sideC * sideC == sideA * sideA + sideB * sideB) { ynJudge.add("Yes"); cnt++; } else { ynJudge.add("No"); cnt++; } } for (int i = 0; i < cnt; i++) { System.out.println(ynJudge.get(i)); } } }
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<String> ynJudge = new ArrayList<>(); int N = sc.nextInt(); int sideA, sideB, sideC; int cnt = 0; for (int i = 0; i < N; i++) { sideA = sc.nextInt(); sideB = sc.nextInt(); sideC = sc.nextInt(); if (sideA * sideA == sideB * sideB + sideC * sideC || sideB * sideB == sideA * sideA + sideC * sideC || sideC * sideC == sideA * sideA + sideB * sideB) { ynJudge.add("YES"); cnt++; } else { ynJudge.add("NO"); cnt++; } } for (int i = 0; i < cnt; i++) { System.out.println(ynJudge.get(i)); } } }
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
205
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int cnt = sc.nextInt(); for (int i = 0; i < cnt; i++) { Integer side[] = new Integer[3]; side[0] = sc.nextInt(); side[1] = sc.nextInt(); side[2] = sc.nextInt(); Arrays.sort(side); if ((side[0] * side[0] + side[1] * side[1]) == side[2] * side[2]) { System.out.println("Yes"); } else System.out.println("No"); } sc.close(); } }
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int cnt = sc.nextInt(); for (int i = 0; i < cnt; i++) { Integer side[] = new Integer[3]; side[0] = sc.nextInt(); side[1] = sc.nextInt(); side[2] = sc.nextInt(); Arrays.sort(side); if ((side[0] * side[0] + side[1] * side[1]) == side[2] * side[2]) { System.out.println("YES"); } else System.out.println("NO"); } sc.close(); } }
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
184
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] strTemp; int numberOfTriangle, data1, data2, data3; /* * Count total of Triangles */ numberOfTriangle = Integer.parseInt(in.readLine()); Triangle[] triangles = new Triangle[numberOfTriangle]; /* * Create all of Triangles */ for (int i = 0; i < numberOfTriangle; i++) { strTemp = in.readLine().split(" "); data1 = Integer.parseInt(strTemp[0]); data2 = Integer.parseInt(strTemp[1]); data3 = Integer.parseInt(strTemp[2]); triangles[i] = new Triangle(data1, data2, data3); } for (int j = 0; j < triangles.length; j++) { if (triangles[j].check()) { System.out.println("Yes"); } else { System.out.println("No"); } } } } class Triangle { private int id, data1, data2, data3, count; private Triangle[] triangles; /* * instance */ public Triangle(int data1, int data2, int data3) { this.data1 = data1; this.data2 = data2; this.data3 = data3; } public boolean check() { int temp1, temp2, temp3; temp1 = (int)Math.pow(data1, 2); temp2 = (int)Math.pow(data2, 2); temp3 = (int)Math.pow(data3, 2); if (temp1 == temp2 + temp3 || temp2 == temp1 + temp3 || temp3 == temp1 + temp2) { return true; } else { return false; } } }
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] strTemp; int numberOfTriangle, data1, data2, data3; /* * Count total of Triangles */ numberOfTriangle = Integer.parseInt(in.readLine()); Triangle[] triangles = new Triangle[numberOfTriangle]; /* * Create all of Triangles */ for (int i = 0; i < numberOfTriangle; i++) { strTemp = in.readLine().split(" "); data1 = Integer.parseInt(strTemp[0]); data2 = Integer.parseInt(strTemp[1]); data3 = Integer.parseInt(strTemp[2]); triangles[i] = new Triangle(data1, data2, data3); } for (int j = 0; j < triangles.length; j++) { if (triangles[j].check()) { System.out.println("YES"); } else { System.out.println("NO"); } } } } class Triangle { private int id, data1, data2, data3, count; private Triangle[] triangles; /* * instance */ public Triangle(int data1, int data2, int data3) { this.data1 = data1; this.data2 = data2; this.data3 = data3; } public boolean check() { int temp1, temp2, temp3; temp1 = (int)Math.pow(data1, 2); temp2 = (int)Math.pow(data2, 2); temp3 = (int)Math.pow(data3, 2); if (temp1 == temp2 + temp3 || temp2 == temp1 + temp3 || temp3 == temp1 + temp2) { return true; } else { return false; } } }
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
375
import java.util.Scanner; class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); // the number of data set int a, b, c; // length for (int i = 0; i < N; i++) { a = scan.nextInt(); b = scan.nextInt(); c = scan.nextInt(); a = a * a; b = b * b; c = c * c; if ((a == b + c) || (b == c + a) || (c == a + b)) { System.out.println("OK"); } else { System.out.println("NO"); } } } }
import java.util.Scanner; class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); // the number of data set int a, b, c; // length for (int i = 0; i < N; i++) { a = scan.nextInt(); b = scan.nextInt(); c = scan.nextInt(); a = a * a; b = b * b; c = c * c; if ((a == b + c) || (b == c + a) || (c == a + b)) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
163
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a, b, c, n, temp; Boolean is_changed = true; n = in.nextInt(); for (int i = 0; i < n; i++) { a = in.nextInt(); b = in.nextInt(); c = in.nextInt(); while (is_changed == true) { is_changed = false; if (a > b) { temp = a; a = b; b = temp; is_changed = true; } if (b > c) { temp = b; b = c; c = temp; is_changed = true; } } if (a * a + b * b - c * c == 0) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a, b, c, n, temp; Boolean is_changed = true; n = in.nextInt(); for (int i = 0; i < n; i++) { a = in.nextInt(); b = in.nextInt(); c = in.nextInt(); while (is_changed == true) { is_changed = false; if (a > b) { temp = a; a = b; b = temp; is_changed = true; } if (b > c) { temp = b; b = c; c = temp; is_changed = true; } } if (a * a + b * b - c * c == 0) { System.out.println("YES"); } else { System.out.println("NO"); } is_changed = true; } } }
[["+", 0, 7, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 12, 146], ["+", 8, 196, 0, 7, 8, 196, 0, 1, 0, 35]]
3
201
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); boolean tri[] = new boolean[N]; int a, b, c, x; for (int i = 0; i < N; i++) { a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); if (a < b) { x = a; a = b; b = x; } if (a < c) { x = a; a = c; c = x; } if (a * a == (b * b) + (c * c)) { tri[i] = true; } else { tri[i] = false; } } for (int i = 0; i < N; i++) { if (tri[i] == true) { System.out.println("Yes"); } else { System.out.println("No"); } } } }
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); boolean tri[] = new boolean[N]; int a, b, c, x; for (int i = 0; i < N; i++) { a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); if (a < b) { x = a; a = b; b = x; } if (a < c) { x = a; a = c; c = x; } if (a * a == (b * b) + (c * c)) { tri[i] = true; } else { tri[i] = false; } } for (int i = 0; i < N; i++) { if (tri[i] == true) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
233
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int x, y, z; int yn[] = new int[n]; for (int i = 0; i < n; i++) { x = scan.nextInt(); y = scan.nextInt(); z = scan.nextInt(); if (x * x + y * y == z * z || x * x + z * z == y * y || y * y + z * z == x * x) yn[i] = 1; } for (int i = 0; i < n; i++) { if (yn[i] == 1) System.out.println("Yes"); else System.out.println("No"); } } }
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int x, y, z; int yn[] = new int[n]; for (int i = 0; i < n; i++) { x = scan.nextInt(); y = scan.nextInt(); z = scan.nextInt(); if (x * x + y * y == z * z || x * x + z * z == y * y || y * y + z * z == x * x) yn[i] = 1; } for (int i = 0; i < n; i++) { if (yn[i] == 1) System.out.println("YES"); else System.out.println("NO"); } } }
[["-", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
194
import static java.util.stream.Collectors.*; import java.io.*; import java.util.stream.Stream; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println( br.lines() .skip(1) .map(s -> Stream.of(s.split(" ")) .mapToInt(Integer::parseInt) .toArray()) .map( i -> Math.pow(i[0], 2) + Math.pow(i[1], 2) == Math.pow(i[2], 2)) .map(b -> b ? "YES" : "NO") .collect(joining("\n"))); } }
import static java.util.stream.Collectors.*; import java.io.*; import java.util.stream.Stream; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println( br.lines() .skip(1) .map(s -> Stream.of(s.split(" ")) .mapToInt(Integer::parseInt) .sorted() .toArray()) .map( i -> Math.pow(i[0], 2) + Math.pow(i[1], 2) == Math.pow(i[2], 2)) .map(b -> b ? "YES" : "NO") .collect(joining("\n"))); } }
[["+", 3, 4, 0, 218, 8, 492, 500, 492, 141, 22], ["+", 0, 218, 8, 492, 500, 492, 3, 4, 0, 24], ["+", 0, 218, 8, 492, 500, 492, 3, 4, 0, 25], ["+", 500, 492, 3, 4, 0, 218, 8, 492, 0, 131]]
3
176
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringBuilder sb = new StringBuilder(); String[] s; int a, b, c; for (int i = 0; i < n; ++i) { s = br.readLine().split(" "); a = Integer.parseInt(s[0]); b = Integer.parseInt(s[1]); c = Integer.parseInt(s[2]); if (a * a == b * b + c * c || b * b == c * c + a * a || c * c == a * a + b * c) { sb.append("YES\n"); } else { sb.append("NO\n"); } } System.out.println(sb); } }
import java.io.BufferedReader; // import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.setIn(new FileInputStream("./input.txt")); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringBuilder sb = new StringBuilder(); String[] s; int a, b, c; for (int i = 0; i < n; ++i) { s = br.readLine().split(" "); a = Integer.parseInt(s[0]); b = Integer.parseInt(s[1]); c = Integer.parseInt(s[2]); if (a * a == b * b + c * c || b * b == c * c + a * a || c * c == a * a + b * b) { sb.append("YES\n"); } else { sb.append("NO\n"); } } System.out.print(sb); } }
[["-", 0, 16, 12, 16, 12, 16, 12, 16, 12, 22], ["+", 0, 16, 12, 16, 12, 16, 12, 16, 12, 22], ["-", 0, 195, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 195, 8, 196, 0, 1, 0, 492, 141, 22]]
3
230
/* Volume0_3 */ import java.io.*; import java.util.Arrays; class Main { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int N = Integer.parseInt(br.readLine()); int[] edges = new int[3]; for (int i = 0; i < N; i++) { String[] str = br.readLine().split(" "); for (int j = 0; j < 3; j++) { edges[j] = Integer.parseInt(str[j]); } Arrays.sort(edges); if (Math.pow(edges[2], 2) == Math.pow(edges[0], 2) + Math.pow(edges[1], 2)) { sb.append("Yes").append("\n"); } else { sb.append("No").append("\n"); } } System.out.print(sb); } catch (Exception e) { System.out.println(e); } } }
/* Volume0_3 */ import java.io.*; import java.util.Arrays; class Main { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int N = Integer.parseInt(br.readLine()); int[] edges = new int[3]; for (int i = 0; i < N; i++) { String[] str = br.readLine().split(" "); for (int j = 0; j < 3; j++) { edges[j] = Integer.parseInt(str[j]); } Arrays.sort(edges); if (Math.pow(edges[2], 2) == Math.pow(edges[0], 2) + Math.pow(edges[1], 2)) { sb.append("YES").append("\n"); } else { sb.append("NO").append("\n"); } } System.out.print(sb); } catch (Exception e) { System.out.println(e); } } }
[["-", 0, 492, 500, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 492, 500, 492, 3, 4, 0, 5, 0, 491]]
3
254
import java.util.*; class Main { public static void main(String[] a) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int[] hen = new int[3]; for (int i = 0; i < N; i++) { for (int x = 0; x < 3; x++) { hen[x] = scanner.nextInt(); } Arrays.sort(hen); if ((hen[2] * hen[2]) == (hen[0] * hen[0] + hen[1] * hen[1])) { System.out.println("yes"); } else { System.out.println("no"); } } } }
import java.util.*; class Main { public static void main(String[] a) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int[] hen = new int[3]; for (int i = 0; i < N; i++) { for (int x = 0; x < 3; x++) { hen[x] = scanner.nextInt(); } Arrays.sort(hen); if ((hen[2] * hen[2]) == (hen[0] * hen[0] + hen[1] * hen[1])) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
167
#include <stdio.h> int main() { double a, b, c, d, e, f; double x, y; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) { if ((x = (1 / (a * e - d * b)) * (e * c + -b * f)) == -0.000000) x = 0.000000; if ((y = (1 / (a * e - d * b)) * (-d * c + a * f)) == -0.000000) y = 0.000000; printf("%lf %lf\n", x, y); } return 0; }
#include <stdio.h> int main() { double a, b, c, d, e, f; double x, y; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) { if ((x = (1 / (a * e - d * b)) * (e * c + -b * f)) == -0.000000) x = 0.000000; if ((y = (1 / (a * e - d * b)) * (-d * c + a * f)) == -0.000000) y = 0.000000; printf("%.3lf %.3lf\n", x, y); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
146
#include <stdio.h> int main(void) { double x, y, a, b, c, d, e, f; while (fscanf(stdin, "%lf %lf %lf %lf %lf %lf\n", &a, &b, &c, &d, &e, &f) >= 0) { x = (f - e * c / b) / (d - e * a / b); y = (f - d * c / a) / (e - d * b / a); x = (x == -0.0) ? 0.0 : x; //-0.0?????? y = (y == -0.0) ? 0.0 : y; printf("%f %f\n", x, y); } return 0; }
#include <stdio.h> int main(void) { double x, y, a, b, c, d, e, f; while (fscanf(stdin, "%lf %lf %lf %lf %lf %lf\n", &a, &b, &c, &d, &e, &f) >= 0) { x = (f - e * c / b) / (d - e * a / b); y = (f - d * c / a) / (e - d * b / a); x = (x == -0.0) ? 0.0 : x; //-0.0?????? y = (y == -0.0) ? 0.0 : y; printf("%.3f %.3f\n", x, y); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
144
#include <stdio.h> int main(void) { int a[6] = {}; int i = 0; double x, y; while (scanf("%d", &a[0]) != EOF) { for (i = 1; i < 6; i++) scanf("%d", &a[i]); y = 1.0 * (a[3] * a[2] - a[0] * a[5]) / (a[3] * a[1] - a[0] * a[4]); x = 1.0 * (a[2] - a[1] * y) / a[0]; printf("%.3f %.3f", x, y); } return 0; }
#include <stdio.h> int main(void) { int a[6] = {}; int i = 0; double x, y; while (scanf("%d", &a[0]) != EOF) { for (i = 1; i < 6; i++) scanf("%d", &a[i]); y = 1.0 * (a[3] * a[2] - a[0] * a[5]) / (a[3] * a[1] - a[0] * a[4]); x = 1.0 * (a[2] - a[1] * y) / a[0]; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
158
#include <stdio.h> int main() { int a, b, c, d, e, f; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { float x = (c * e - b * f) / (a * e - b * d); if (x == 0) x = 0; float y = (float)(c * d - a * f) / (b * d - e * a); if (y == 0) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
#include <stdio.h> int main() { int a, b, c, d, e, f; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { float x = (float)(c * e - b * f) / (a * e - b * d); if (x == 0) x = 0; float y = (float)(c * d - a * f) / (b * d - e * a); if (y == 0) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["+", 49, 50, 51, 16, 31, 74, 51, 23, 0, 24]]
0
136
#include <stdio.h> int main(void) { double a, b, c, d, e, f; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) > 0) { f = (f - c / a * d) - (e - b / a * d); c = c / a - f * b / a; printf("%.3f %.3f\n", c, f); } return 0; }
#include <stdio.h> int main() { double a, b, c, d, e, f; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) > 0) { f = (f - c / a * d) / (e - b / a * d); c = c / a - f * b / a; printf("%.3f %.3f\n", c, f); } return 0; }
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85]]
0
102
#include <stdio.h> int main(void) { double a, b, c, d, e, f; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) { f = (f - c / a * d) - (e - b / a * d); c = c / a - f * b / a; printf("%.3f %.3f\n", c, f); } return 0; }
#include <stdio.h> int main(void) { double a, b, c, d, e, f; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) { f = (f - c / a * d) / (e - b / a * d); c = c / a - f * b / a; printf("%.3f %.3f\n", c, f); } return 0; }
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85]]
0
102
#include <stdio.h> int main(void) { float x, y; int a, b, c, d, e, f; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { x = (c * e - b * f) / (a * e - b * d); y = (d * c - a * f) / (b * d - a * e); if (x <= 0 && -0.0005 < x) x = 0; if (y <= 0 && -0.0005 < y) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
#include <stdio.h> int main(void) { float x, y; int a, b, c, d, e, f; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { x = (float)(c * e - b * f) / (a * e - b * d); y = (float)(d * c - a * f) / (b * d - a * e); if (x <= 0 && -0.0005 < x) x = 0; if (y <= 0 && -0.0005 < y) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["+", 0, 11, 12, 16, 31, 74, 51, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24]]
0
145
#include <stdio.h> #include <stdlib.h> int main() { int a, b, c, d, e, f; float x, y; while (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF) { /*if((b>=0&&e>=0)||(b<0&&e<0)){ x=(c*abs(e)-f*abs(b))/(a*abs(e)-d*abs(b)); y=(d*abs(c)-f*abs(a))/(b*abs(d)-e*abs(a)); } else{ x=(c*abs(e)+f*abs(b))/(a*abs(e)+d*abs(b)); y=(d*abs(c)+f*abs(a))/(b*abs(d)+e*abs(a)); }*/ x = (c * e - f * b) / (a * e - d * b); y = (d * c - f * a) / (b * d - e * a); if (-0.0005 < x && x <= 0) x = 0; if (-0.0005 < y && y <= 0) y = 0; printf("%1.3f %1.3f\n", x, y); } return 0; }
#include <stdio.h> #include <stdlib.h> int main() { int a, b, c, d, e, f; float x, y; while (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF) { /*if((b>=0&&e>=0)||(b<0&&e<0)){ x=(c*abs(e)-f*abs(b))/(a*abs(e)-d*abs(b)); y=(d*abs(c)-f*abs(a))/(b*abs(d)-e*abs(a)); } else{ x=(c*abs(e)+f*abs(b))/(a*abs(e)+d*abs(b)); y=(d*abs(c)+f*abs(a))/(b*abs(d)+e*abs(a)); }*/ x = (float)(c * e - f * b) / (a * e - d * b); y = (float)(d * c - f * a) / (b * d - e * a); if (-0.0005 < x && x <= 0) x = 0; if (-0.0005 < y && y <= 0) y = 0; printf("%1.3f %1.3f\n", x, y); } return 0; }
[["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["+", 0, 11, 12, 16, 31, 74, 51, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24]]
0
147
#include <stdio.h> int main(void) { int a, b, c, d, e, f; float x, y; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { x = (float)(c * e - f * b) / (a * e - d * b); y = (float)(c * d - f * a) / (b * d - e * a); if (x == -0.0) { x = 0.0; } if (y == -0.0) { y = 0.0; } printf("%.3f %.3f", x, y); } return 0; }
#include <stdio.h> int main(void) { int a, b, c, d, e, f; float x, y; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { x = (float)(c * e - f * b) / (a * e - d * b); y = (float)(c * d - f * a) / (b * d - e * a); if (x == -0.0) { x = 0.0; } if (y == -0.0) { y = 0.0; } printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
146
#include <stdio.h> int main(void) { int a, b, c, d, e, f; double x, y; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { x = (c * e - b * f) / (a * e - d * b); y = (a * f - c * d) / (a * e - d * b); if (-0.0005 < x && x < 0.0005) x = 0; if (-0.0005 < y && y < 0.0005) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
#include <stdio.h> int main(void) { int a, b, c, d, e, f; double x, y; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { x = (float)(c * e - b * f) / (a * e - d * b); y = (float)(a * f - c * d) / (a * e - d * b); if (-0.0005 < x && x < 0.0005) x = 0; if (-0.0005 < y && y < 0.0005) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["+", 0, 11, 12, 16, 31, 74, 51, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24]]
0
145
#include <stdio.h> int main(void) { float a, b, c, d, e, f, x, y; while (scanf("%f%f%f%f%f%f", &a, &b, &c, &d, &e, &f) != EOF) { y = (c * d - f * a) / (b * d - e * a); x = (c - b * y) / a; printf("%.3f %.3f", x, y); } return 0; }
#include <stdio.h> int main(void) { float a, b, c, d, e, f, x, y; while (scanf("%f%f%f%f%f%f", &a, &b, &c, &d, &e, &f) != EOF) { y = (c * d - f * a) / (b * d - e * a); x = (c - b * y) / a; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
105
#include <stdio.h> int main(void) { float x, y, a, b, c, d, e, f; while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF) { y = (((d * c) - (a * f)) / ((d * b) - (a * e))); x = (c - (b * y)) / a; printf("%f %f\n", x, y); } return 0; }
#include <stdio.h> int main(void) { float x, y, a, b, c, d, e, f; while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF) { y = (((d * c) - (a * f)) / ((d * b) - (a * e))); x = (c - (b * y)) / a; printf("%.3f %.3f\n", x, y); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
118
float d, b, f, e, c, a; main(x) { for (; ~scanf("%f", &a + x);) if (--x == -6) d = a * d - f * e, x = !printf("%.3f %.3f\n", (e - c * d) / a, d /= a * b - c * f); exit(0); }
float d, b, f, e, c, a; X; main() { for (; ~scanf("%f", &a + X);) if (--X == -6) d = a * d - f * e, X = !printf("%.3f %.3f\n", (e - c * d) / a, d /= a * b - c * f); exit(0); }
[["+", 36, 36, 36, 36, 0, 30, 0, 1, 0, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 1, 0, 35], ["-", 36, 36, 0, 30, 0, 14, 49, 65, 0, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 15, 91, 28, 2, 3, 4, 0, 16, 12, 22], ["+", 15, 91, 28, 2, 3, 4, 0, 16, 12, 22], ["-", 8, 57, 15, 23, 0, 16, 31, 27, 28, 22], ["+", 8, 57, 15, 23, 0, 16, 31, 27, 28, 22], ["-", 8, 57, 64, 1, 0, 34, 12, 11, 31, 22], ["+", 8, 57, 64, 1, 0, 34, 12, 11, 31, 22]]
0
89
#include <stdio.h> int main() { int a, b, c, d, e, f; while (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF) { printf("%lf %lf\n", (double)(c * e - b * f) / (a * e - b * d) + 1e-15, (double)(a * f - c * d) / (a * e - b * d) + 1e-15); } return 0; }
#include <stdio.h> int main() { int a, b, c, d, e, f; while (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF) { printf("%.3lf %.3lf\n", (double)(c * e - b * f) / (a * e - b * d) + 1e-15, (double)(a * f - c * d) / (a * e - b * d) + 1e-15); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
113
main() { double a, b, c, d, e, f, g, h; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != -1) { g = (b * f - c * e) / (b * d - a * e); h = (a * f - c * d) / (a * e - b * d); if (0.0005 > g) if (g > -0.0005) g = 0.0; if (0.0005 > h) if (h > -0.0005) h = 0.0; printf("%lf %lf\n", g, h); } return 0; }
main() { double a, b, c, d, e, f, g, h; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != -1) { g = (b * f - c * e) / (b * d - a * e); h = (a * f - c * d) / (a * e - b * d); if (0.0005 > g) if (g > -0.0005) g = 0.0; if (0.0005 > h) if (h > -0.0005) h = 0.0; printf("%.3lf %.3lf\n", g, h); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
144
#include <stdio.h> int main(void) { int xs[2], ys[2], eqs[2]; float x, y; while (~scanf("%d %d %d %d %d %d", xs, ys, eqs, xs + 1, ys + 1, eqs + 1)) { x = (eqs[0] * ys[1] - eqs[1] * ys[0]) / (xs[0] * ys[1] - xs[1] * ys[0]); y = (eqs[1] * xs[0] - eqs[0] * xs[1]) / (xs[0] * ys[1] - xs[1] * ys[0]); if (x == 0.0) x = 0.0; if (y == 0.0) y = 0.0; printf("%.3f %.3f\n", x, y); } return (0); }
#include <stdio.h> int main(void) { int xs[2], ys[2], eqs[2]; float x, y; while (~scanf("%d %d %d %d %d %d", xs, ys, eqs, xs + 1, ys + 1, eqs + 1)) { x = 1. * (eqs[0] * ys[1] - eqs[1] * ys[0]) / (xs[0] * ys[1] - xs[1] * ys[0]); y = 1. * (eqs[1] * xs[0] - eqs[0] * xs[1]) / (xs[0] * ys[1] - xs[1] * ys[0]); if (x == 0.0) x = 0.0; if (y == 0.0) y = 0.0; printf("%.3f %.3f\n", x, y); } return (0); }
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48]]
0
189
#include <stdio.h> int main(void) { int xs[2], ys[2], eqs[2]; float x, y; while (~scanf("%d %d %d %d %d %d", xs, ys, eqs, xs + 1, ys + 1, eqs + 1)) { x = -1. * (eqs[0] * ys[1] + eqs[1] * ys[0]) / (xs[0] * ys[1] - xs[1] * ys[0]); y = 1. * (eqs[1] * xs[0] - eqs[0] * xs[1]) / (xs[0] * ys[1] - xs[1] * ys[0]); // if (x == 0.0) x = 0.0; printf("%.3f %.3f\n", x, y); } return (0); }
#include <stdio.h> int main(void) { int xs[2], ys[2], eqs[2]; float x, y; while (~scanf("%d %d %d %d %d %d", xs, ys, eqs, xs + 1, ys + 1, eqs + 1)) { x = 1. * (eqs[0] * ys[1] - eqs[1] * ys[0]) / (xs[0] * ys[1] - xs[1] * ys[0]); y = 1. * (eqs[1] * xs[0] - eqs[0] * xs[1]) / (xs[0] * ys[1] - xs[1] * ys[0]); printf("%.3f %.3f\n", x ?: 0, y); } return (0); }
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 41, 0, 101], ["+", 0, 1, 0, 2, 3, 4, 0, 41, 0, 102], ["+", 0, 1, 0, 2, 3, 4, 0, 41, 75, 13]]
0
174