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
change_count
int64
0
100
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) { vector<double> a(2), b(2), c(2), d(2); double tmp; cin >> a[0] >> a[1] >> b[0] >> b[1] >> c[0] >> c[1] >> d[0] >> d[1]; double x1 = b[0] - a[0], y1 = b[1] - a[1]; double x2 = ...
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) { vector<double> a(2), b(2), c(2), d(2); double tmp; cin >> a[0] >> a[1] >> b[0] >> b[1] >> c[0] >> c[1] >> d[0] >> d[1]; double x1 = b[0] - a[0], y1 = b[1] - a[1]; double x2 = ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 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
188
6
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #incl...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #incl...
[["+", 8, 9, 0, 37, 0, 16, 31, 2, 63, 22], ["+", 0, 37, 0, 16, 31, 2, 3, 4, 0, 24], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
1,192
3
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <vector> using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII;...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <vector> using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII;...
[["+", 0, 57, 15, 339, 51, 16, 31, 2, 63, 22], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]]
1
335
3
#include <cstdint> #include <iostream> int main() { std::uint32_t n; std::cin >> n; for (std::uint32_t i = 0; i < n; ++i) { double x1, y1, x2, y2, x3, y3, x4, y4; std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4; if ((x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2) == 0.0) { std::cout << "...
#include <cstdint> #include <iostream> int main() { std::uint32_t n; std::cin >> n; for (std::uint32_t i = 0; i < n; ++i) { double x1, y1, x2, y2, x3, y3, x4, y4; std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4; if ((x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2) != 0.0) { std::cout << "...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
136
2
#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) { double abdx, abdy, cddx, cddy; double x[4]; double y[4]; for (int j = 0; j < 4; ++j) { cin >> x[j] >> y[j]; } abdx = x[0] - x[1]; cddx = x[2] - x[3]; abdy = y[0] - y[1]; c...
#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) { double abdx, abdy, cddx, cddy; double x[4]; double y[4]; for (int j = 0; j < 4; ++j) { cin >> x[j] >> y[j]; } abdx = x[0] - x[1]; cddx = x[2] - x[3]; abdy = y[0] - y[1]; c...
[["-", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["-", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25], ["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
163
6
#include <cmath> #include <iostream> using namespace std; #define EPS 1e-10 int main() { int n; double x1, x2, x3, x4, y1, y2, y3, y4; cin >> n; while (n--) { cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4; if (abs((x4 - x3) * (y2 - y1) - (x2 - x1) * (y4 - y2)) < EPS) cout << "YES" << endl; ...
#include <cmath> #include <iostream> using namespace std; #define EPS 1e-10 int main() { int n; double x1, x2, x3, x4, y1, y2, y3, y4; cin >> n; while (n--) { cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4; if (abs((x4 - x3) * (y2 - y1) - (x2 - x1) * (y4 - y3)) < EPS) cout << "YES" << endl; ...
[["-", 0, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 12, 22]]
1
114
2
#include <iostream> #include <map> using namespace std; int main(void) { int n, x[2], y[2]; pair<int, int> v[2]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < 2; j++) { cin >> x[0] >> y[0] >> x[1] >> y[1]; v[j] = make_pair(x[0] - x[1], y[0] - y[1]); } cout << (v[0].first...
#include <iostream> #include <map> using namespace std; int main(void) { int n; float x[2], y[2]; pair<float, float> v[2]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < 2; j++) { cin >> x[0] >> y[0] >> x[1] >> y[1]; v[j] = make_pair(x[0] - x[1], y[0] - y[1]); } cout <<...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 31, 16, 12,...
1
170
11
#include <cmath> #include <complex> #include <iostream> using namespace std; typedef complex<double> xy_t; double cross_product(xy_t a, xy_t b) { return (conj(a) * b).imag(); } const double eps = 1e-12; double x[4], y[4]; int N; int main() { cin >> N; for (int i = 0; i < N; ++i) { for (int i = 0; i < 4; ++i) {...
#include <cmath> #include <complex> #include <iostream> using namespace std; typedef complex<double> xy_t; double cross_product(xy_t a, xy_t b) { return (conj(a) * b).imag(); } const double eps = 1e-11; double x[4], y[4]; int N; int main() { cin >> N; for (int i = 0; i < N; ++i) { for (int i = 0; i < 4; ++i) {...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["-", 49, 50, 51, 16, 31, 2, 3, 4, 0, 25], ["-", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 31, 16, 12, ...
1
215
8
gets $<.map{|l|a,b,c,d,e,f,g,h=l.split.map &:to_f puts ((a-c)*(f-h)-(b-d)*(e-g)).abs>1e-15?:YES: :NO}
gets $<.map{|l|a,b,c,d,e,f,g,h=l.split.map &:to_f puts ((a-c)*(f-h)-(b-d)*(e-g)).abs<1e-10?:YES: :NO}
[["-", 0, 652, 3, 4, 0, 754, 15, 738, 17, 47], ["-", 0, 652, 3, 4, 0, 754, 15, 738, 12, 531], ["+", 0, 652, 3, 4, 0, 754, 15, 738, 17, 18], ["+", 0, 652, 3, 4, 0, 754, 15, 738, 12, 531]]
4
66
4
n=gets.to_i;n.times{a,b,c,d,e,f,g,h=gets.split.map &:to_f;puts ((c-a)*(h-f)-(d-b)*(g-e)).abs<1e10 ?"YES":"NO"}
n=gets.to_i;n.times{a,b,c,d,e,f,g,h=gets.split.map &:to_f;puts ((c-a)*(h-f)-(d-b)*(g-e)).abs<1e-10 ?"YES":"NO"}
[["-", 0, 652, 3, 4, 0, 754, 15, 738, 12, 531], ["+", 0, 652, 3, 4, 0, 754, 15, 738, 12, 531]]
4
73
2
def slope(x1, y1, x2, y2) return (y2 - y1).round/(x2 - x1).round end result = [] gets.to_i.times{ xa, ya, xb, yb, xc, yc, xd, yd = gets.split.map(&:to_f) ab = slope(xa, ya, xb, yb) cd = slope(xc, yc, xd, yd) result << ((ab == cd) ? "YES" : "NO") } result.each{|r| puts r }
def slope(x1, y1, x2, y2) return (y2 - y1).round(6)/(x2 - x1).round(6) end result = [] gets.to_i.times{ xa, ya, xb, yb, xc, yc, xd, yd = gets.split.map(&:to_f) ab = slope(xa, ya, xb, yb) cd = slope(xc, yc, xd, yd) result << ((ab == cd) ? "YES" : "NO") } result.each{|r| puts r }
[["+", 0, 4, 0, 738, 31, 652, 3, 4, 0, 24], ["+", 0, 4, 0, 738, 31, 652, 3, 4, 0, 612], ["+", 0, 4, 0, 738, 31, 652, 3, 4, 0, 25], ["+", 0, 4, 0, 738, 12, 652, 3, 4, 0, 24], ["+", 0, 4, 0, 738, 12, 652, 3, 4, 0, 612], ["+", 0, 4, 0, 738, 12, 652, 3, 4, 0, 25]]
4
115
6
num = gets.chomp.to_i num.times do |n| x1, y1, x2, y2, x3, y3, x4, y4 = gets.chomp.split(" ").map(&:to_f) if y2 == y1 || y4 == y3 if y2 == y1 && y4 == y3 puts "YES" else puts "NO" end next elsif (x2 - x1)/(y2 - y1) - (x4 - x3)/(y4 - y3) < 1e-10 ...
num = gets.chomp.to_i num.times do |n| x1, y1, x2, y2, x3, y3, x4, y4 = gets.chomp.split(" ").map(&:to_f) if y2 == y1 || y4 == y3 if y2 == y1 && y4 == y3 puts "YES" else puts "NO" end next elsif ((x2 - x1)/(y2 - y1) - (x4 - x3)/(y4 - y3)).abs < 1e-10 ...
[["+", 486, 739, 0, 738, 31, 738, 31, 739, 0, 24], ["+", 486, 739, 0, 738, 12, 738, 12, 739, 0, 25], ["+", 0, 121, 75, 759, 15, 738, 31, 652, 17, 131], ["+", 0, 121, 75, 759, 15, 738, 31, 652, 735, 22]]
4
110
4
N = input() for n in range(N): data = map(float,input().split( )) slopes = [] for i in range(2): _x1 = data.pop(0) _y1 = data.pop(0) _x2 = data.pop(0) _y2 = data.pop(0) if _x1 != _x2: slopes.append((_y1 - _y2)/(_x1 - _x2)) if len(slop...
N = eval(input()) for n in range(N): data = list(map(float,input().split( ))) slopes = [] for i in range(2): _x1 = data.pop(0) _y1 = data.pop(0) _x2 = data.pop(0) _y2 = data.pop(0) if _x1 != _x2: slopes.append((_y1 - _y2)/(_x1 - _x2)) ...
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
150
6
N = int(input()) for i in range(0, N) : x1,y1,x2,y2,x3,y3,x4,y4 = list(map(float, input().split())) s = x2 - x1 t = y2 - y1 u = x4 - x3 v = y4 - y3; if (s * v - t * u < 1.000000001) : print("YES") else : print("NO")
N = int(input()) for i in range(0, N) : x1,y1,x2,y2,x3,y3,x4,y4 = list(map(float, input().split())) s = x2 - x1 t = y2 - y1 u = x4 - x3 v = y4 - y3; if (abs(s * v - t * u) < 1e-10) : print("YES") else : print("NO")
[["+", 0, 57, 15, 23, 0, 666, 0, 652, 63, 22], ["+", 15, 23, 0, 666, 0, 652, 3, 4, 0, 24], ["+", 15, 23, 0, 666, 0, 652, 3, 4, 0, 25], ["-", 8, 196, 0, 57, 15, 23, 0, 666, 0, 531], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 0, 531]]
5
97
5
n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) dx12, dx34, dy12, dy34 = x1 - x2, x3 - x4, y1 - y2, y3 - y4 print('YES' if dx12 * dy34 - dy12 * dx34 < 1e-10 else 'NO')
n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) dx12, dx34, dy12, dy34 = x1 - x2, x3 - x4, y1 - y2, y3 - y4 print('YES' if abs(dx12 * dy34 - dy12 * dx34) < 1e-10 else 'NO')
[["+", 3, 4, 0, 41, 0, 666, 0, 652, 63, 22], ["+", 0, 41, 0, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 41, 0, 666, 0, 652, 3, 4, 0, 25]]
5
87
3
def cross(x, y): return (x.conjugate() * y).imag #x, y: direction vector def is_parallel(x, y): if cross(x, y) < 1e-6: return True return False n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) a = complex(x2, y2) - complex(x1, y1) b = com...
def cross(x, y): return (x.conjugate() * y).imag def is_parallel(x, y): if abs(cross(x, y)) < 1e-10: return True return False n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) a = complex(x2, y2) - complex(x1, y1) b = complex(x4, y4) - com...
[["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["-", 0, 14, 8, 196, 0, 57, 15, 666, 0, 531], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 0, 531]]
5
139
5
for i in range(int(input())): s = list(map(float,input().split())) if s[1] - s[3] == 0 or s[5] - s[7] == 0: if s[1] - s[3] == s[5] - s[7] == 0: print('YES') else: print('NO') elif (s[0] - s[2]) / (s[1] - s[3]) - (s[4] - s[6]) / (s[5] - s[7]) < 1e-10: print('YE...
for i in range(int(input())): s = list(map(float,input().split())) if s[1] - s[3] == 0 or s[5] - s[7] == 0: if s[1] - s[3] == s[5] - s[7] == 0: print('YES') else: print('NO') elif abs((s[0] - s[2]) / (s[1] - s[3]) - (s[4] - s[6]) / (s[5] - s[7])) < 1e-10: prin...
[["+", 0, 57, 75, 665, 15, 666, 0, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 12, 657, 12, 23, 0, 25]]
5
157
3
for _ in range(int(input())): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) print(['NO','YES'][(ay-by)*(dx-cx)-(ax-bx)*(dy-cy)<1e-10])
for _ in range(int(input())): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) print(['NO','YES'][abs((ay-by)*(dx-cx)-(ax-bx)*(dy-cy))<1e-10])
[["+", 3, 4, 0, 206, 206, 666, 0, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 12, 657, 12, 23, 0, 25]]
5
80
3
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int v; while (cin >> v) { int N = 0; for (;; ++N) { int y = 5 * N - 5; if (v * v * 10 <= 196 * y) break; } cout << N << endl; } return 0; }
#include <iostream> #include <string> #include <vector> using namespace std; int main() { double v; while (cin >> v) { int N = 0; for (;; ++N) { int y = 5 * N - 5; if (v * v * 10 <= 196 * y) break; } cout << N << endl; } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
73
2
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { double in; int ans; while (scanf("%lf", &in) != EOF) { ans = (int)(in * in / 98); printf("%d\n", ans + 1...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { double in; int ans; while (scanf("%lf", &in) != EOF) { ans = ceil(in * in / 98); printf("%d\n", ans + 1)...
[["-", 8, 9, 0, 1, 0, 11, 12, 74, 0, 24], ["-", 0, 1, 0, 11, 12, 74, 39, 77, 39, 40], ["-", 8, 9, 0, 1, 0, 11, 12, 74, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22]]
1
78
4
#include <algorithm> #include <climits> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <utility> #include <vector> using namespace std; int main() { int x; while (cin >> x) { double h = 4.9 * x * x / 9.8 / 9.8; int y = 0; while (5 * y - 5 < h) y++; cout <...
#include <algorithm> #include <climits> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <utility> #include <vector> using namespace std; int main() { double x; while (cin >> x) { double h = 4.9 * x * x / 9.8 / 9.8; int y = 0; while (5 * y - 5 < h) y++; cou...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
77
2
#include <algorithm> #include <climits> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <utility> #include <vector> using namespace std; int main() { int x; while (cin >> x) { double h = (5 + 4.9 * x / 9.8 * x / 9.8) / 5; int y = 0; while (y < h) y++; cout...
#include <algorithm> #include <climits> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <utility> #include <vector> using namespace std; int main() { double x; while (cin >> x) { double h = (5 + 4.9 * x / 9.8 * x / 9.8) / 5; int y = 0; while (y < h) y++; c...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
79
2
#include <cmath> #include <iostream> using namespace std; int main() { double v; while (cin >> v) { double y = v * v / 19.8; double N = (y + 5.0) / 5.0; cout << ceil(N) << endl; } return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { double v; while (cin >> v) { double y = v * v / 19.6; double N = (y + 5.0) / 5.0; cout << ceil(N) << endl; } return 0; }
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
57
2
#include <stdio.h> int main() { double v = 0.0, t = 0.0, y = 0.0; while (scanf("%lf", &v) != EOF) { t = v / 9.8; y = 4.9 * t * t; printf("%.0f\n", (y / 5 + 1)); } return 0; }
#include <stdio.h> int main() { double v = 0.0, t = 0.0, y = 0.0; while (scanf("%lf", &v) != EOF) { t = v / 9.8; y = 4.9 * t * t; printf("%.0f\n", (y / 5 + 1) + 0.5); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
70
2
#include <iostream> #define rep(i, a, n) for (int i = a; i < n; i++) using namespace std; int main() { double v; while (cin >> v) { double t = v / 9.8; double y = t * t * 4.9; int ans = 0; rep(i, 0, 60) { int h = 5 * (i - 1); if (h > y) { ans = i; break; } } ...
#include <iostream> #define rep(i, a, n) for (int i = a; i < n; i++) using namespace std; int main() { double v; while (cin >> v) { double t = v / 9.8; double y = t * t * 4.9; int ans = 0; rep(i, 1, 600) { double h = 5 * (i - 1); if (h > y) { ans = i; break; } ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 52, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 0, 52, 8, 9, 0, 9, 0, 43, 39, 40]]
1
96
6
#include <cmath> #include <iostream> using namespace std; /* v = 9.8t y = 4.8t^2 割れる速度になるtを求め、その時間でどのくらいの距離になるか計算する。 */ int main() { double v; while (cin >> v) { double t = v / 9.8; double y = 4.8 * t * t; int N = static_cast<int>(ceil(y / 5) + 1); cout << N << endl; } ...
#include <cmath> #include <iostream> using namespace std; /* v = 9.8t y = 4.8t^2 割れる速度になるtを求め、その時間でどのくらいの距離になるか計算する。 */ int main() { double v; while (cin >> v) { double t = v / 9.8; double y = 4.9 * t * t; int N = static_cast<int>(ceil(y / 5)) + 1; cout << N << endl; } ...
[["-", 0, 43, 49, 50, 51, 16, 31, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 31, 13], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]]
1
66
4
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <typeinfo> #include <vector> #define PI 3.14159265359 #define INF 99999999 #define rep(i, n...
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <typeinfo> #include <vector> #define PI 3.14159265359 #define INF 99999999 #define rep(i, n...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
120
4
#include <bits/stdc++.h> using namespace std; int main() { double v, y; int n; while (cin >> v) { y = v * v / 19.6; n = (y - 1) / 5; cout << n + 2 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { double v, y; int n; while (cin >> v) { y = v * v / 19.6; n = (y - 0.0000000001) / 5; cout << n + 2 << endl; } return 0; }
[["-", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13]]
1
57
2
#define _USE_MATH_DEFINES #include <algorithm> #include <cctype> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define INF (1 << 20) #define EPS (1e-10) #define EQ(a, b) (fabs((a) - (b)) < EPS) int...
#define _USE_MATH_DEFINES #include <algorithm> #include <cctype> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define INF (1 << 20) #define EPS (1e-10) #define EQ(a, b) (fabs((a) - (b)) < EPS) int...
[["-", 0, 52, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 17, 33]]
1
88
2
#include <iostream> using namespace std; int main() { double a, b, c; while (cin >> a) { b = 0; int s = 0; while (1) { if (9.8 * b >= a) break; b += 0.01; } while (1) { if (4.9 * b * b <= s) break; s += 5; } cout << s / 5 + 1 << endl; } }
#include <iostream> using namespace std; int main() { double a, b, c; while (cin >> a) { b = 0; int s = 0; while (1) { if (9.8 * b >= a) break; b += 0.0000001; } while (1) { if (4.9 * b * b <= s) break; s += 5; } cout << s / 5 + 1 << endl; } }
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13]]
1
88
2
// clang-format off #include <bits/stdc++.h> #define int long long #define main signed main() // #define main int main() #define loop(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) loop(i, 0, n) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define prec(n) fixed << setprecis...
// clang-format off #include <bits/stdc++.h> #define int long long #define main signed main() // #define main int main() #define loop(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) loop(i, 0, n) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define prec(n) fixed << setprecis...
[["-", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13]]
1
408
2
#include <cmath> #include <iostream> using namespace std; int main() { double v, y; cin >> v; y = 4.9 * pow(v / 9.8, 2); int n; for (n = 0;; n++) { if (y <= 5 * n - 5) break; } cout << n << endl; return 0; } // 25.4 // 32
#include <cmath> #include <iostream> using namespace std; int main() { double v, y; while (cin >> v) { y = 4.9 * pow(v / 9.8, 2); int n; for (n = 0;; n++) { if (y <= 5 * n - 5) break; } cout << n << endl; } return 0; } // 25.4 // 32
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
74
6
#include <cmath> #include <iostream> using namespace std; int main() { double v, y; while (cin >> v) { y = 4.9 * pow(v / 9.8, 2); int n = 0; while (n++) if (y <= 5 * n - 5) break; cout << n << endl; } return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { double v, y; while (cin >> v) { y = 4.9 * pow(v / 9.8, 2); int n = 0; for (n;; n++) if (y <= 5 * n - 5) break; cout << n << endl; } return 0; }
[["-", 8, 9, 0, 52, 8, 9, 0, 52, 0, 89], ["+", 8, 9, 0, 52, 8, 9, 0, 7, 0, 88], ["+", 8, 9, 0, 52, 8, 9, 0, 7, 10, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 7, 0, 35]]
1
71
5
#include <iostream> main() { for (double v; std::cin >> v;) std::cout << (int)v * v / 98 + 2 << "\n"; }
#include <iostream> main() { for (double v; std::cin >> v;) std::cout << (int)(v * v / 98 + 2) << "\n"; }
[["+", 0, 16, 31, 16, 12, 74, 51, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 74, 51, 23, 0, 25]]
1
38
2
#include <iostream> using namespace std; int main() { double v0; while (scanf("%lf ", &v0) == 1) { cout << (int)((v0 * v0) / (5.0 * 4.0 * 4.9)) + 1 << endl; } }
#include <cstdio> #include <iostream> using namespace std; int main() { double v0; while (scanf("%lf ", &v0) == 1) { cout << (int)((v0 * v0) / (5.0 * 4.0 * 4.9)) + 2 << endl; } }
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
56
4
#include <iostream> using namespace std; int main(void) { double v; while (cin >> v) { double t = v / 9.8; int y = (4.9 * t * t) + 4; cout << y / 5 + 1 << endl; } return 0; }
#include <iostream> using namespace std; int main(void) { double v; while (cin >> v) { double t = v / 9.8; int y = (4.9 * t * t) + 5; cout << y / 5 + 1 << endl; } return 0; }
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
57
2
#include <stdio.h> int main() { int n; double v, y; while (scanf("%lf", &v) != EOF) { y = (v / 2.0) * (v / 9.8); n = (y + 5) / 5; printf("%d\n", n); } return 0; }
#include <stdio.h> int main() { int n; double v, y; while (scanf("%lf", &v) != EOF) { y = (v / 2.0) * (v / 9.8); n = (y + 5) / 5; printf("%d\n", n + 1); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
69
2
#include <cstdio> #include <iostream> #include <math.h> using namespace std; int main(void) { double v; while (cin >> v) { double n, k; n = (4.9 * (v / 9.8) * (v / 9.8) + 5) / 5; k = n - (int)n; if (0 == k) ; else { n++; } cout << n << endl; } return 0; }
#include <cstdio> #include <iostream> #include <math.h> using namespace std; int main(void) { double v; while (cin >> v) { double n, k; n = (4.9 * (v / 9.8) * (v / 9.8) + 5) / 5; k = n - (int)n; if (0 == k) ; else { n++; } cout << (int)n << endl; } return 0; }
[["+", 0, 1, 0, 16, 31, 16, 12, 74, 0, 24], ["+", 0, 16, 31, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 16, 31, 16, 12, 74, 0, 25]]
1
86
3
#include <iostream> using namespace std; int main(void) { double v, t, y, N; cin >> v; t = v / 9.8; y = 4.9 * t * t; N = (y + 5) / 5; cout << (int)++N << endl; return 0; }
#include <iostream> using namespace std; int main(void) { double v, t, y, N; while (cin >> v) { t = v / 9.8; y = 4.9 * t * t; N = (y + 5) / 5; cout << (int)++N << endl; } return 0; }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
63
6
#include <iostream> using namespace std; int main() { double v, y; int n; while (cin >> v) { y = (v * v) / 19.6; n = y / 5 + 2; cout << n; } return 0; }
#include <iostream> using namespace std; int main() { double v, y; int n; while (cin >> v) { y = (v * v) / 19.6; n = y / 5 + 2; cout << n << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
53
2
(gets.to_i).times do xa,ya,ra,xb,yb,rb=gets.chomp.split(nil).map(&:to_f) r=Math::sqrt((xa-xb)**2+(ya-yb)**2) if(d+rb)<ra puts 2 elsif(d+ra)<rb puts -2 elsif d<(ra+rb) puts 1 else puts 0 end end
(gets.to_i).times do xa,ya,ra,xb,yb,rb=gets.chomp.split(nil).map(&:to_f) r=Math::sqrt((xa-xb)**2+(ya-yb)**2) if(r+rb)<ra puts 2 elsif(r+ra)<rb puts -2 elsif r<=(ra+rb) puts 1 else puts 0 end end
[["-", 0, 121, 15, 738, 31, 739, 0, 738, 31, 22], ["+", 0, 121, 15, 738, 31, 739, 0, 738, 31, 22], ["-", 75, 759, 15, 738, 31, 739, 0, 738, 31, 22], ["+", 75, 759, 15, 738, 31, 739, 0, 738, 31, 22], ["-", 0, 121, 75, 759, 75, 759, 15, 738, 31, 22], ["-", 0, 121, 75, 759, 75, 759, 15, 738, 17, 18], ["+", 0, 121, 75, 759...
4
92
8
while n = gets n.to_i.times{ xa,ya,ra,xb,yb,rb = gets.split.map(&:to_f) dist = ((xa-xb)**2+(ya-yb)**2)**0.5 if dist > ra+rb then puts 0 elsif rb < ra and dist < rb-ra puts 2 elsif ra < rb and dist < rb-ra puts -2 else puts 1 end } end
while n = gets n.to_i.times{ xa,ya,ra,xb,yb,rb = gets.split.map(&:to_f) dist = ((xa-xb)**2+(ya-yb)**2)**0.5 if dist > ra+rb then puts 0 elsif rb < ra and dist < ra-rb puts 2 elsif ra < rb and dist < rb-ra puts -2 else puts 1 end } end
[["-", 75, 759, 15, 738, 12, 738, 12, 738, 31, 22], ["-", 75, 759, 15, 738, 12, 738, 12, 738, 17, 33], ["+", 75, 759, 15, 738, 12, 738, 12, 738, 17, 33], ["+", 75, 759, 15, 738, 12, 738, 12, 738, 12, 22]]
4
92
4
class Circle def compare(list) xa, ya, ra, xb, yb, rb = list cd = center_distance(xa, ya, xb, yb) return 0 if cd > (ra - rb).abs return 2 if cd + rb < ra return -2 if cd + ra < rb 0 end def center_distance(xa, ya, xb, yb) ((ya - yb)**2 + (xa - xb)**2)**(1 / 2.0) end end n = STDIN...
class Circle def compare(list) xa, ya, ra, xb, yb, rb = list cd = center_distance(xa, ya, xb, yb) return 0 if cd > ra + rb return 2 if cd + rb < ra return -2 if cd + ra < rb 1 end def center_distance(xa, ya, xb, yb) ((ya - yb)**2 + (xa - xb)**2)**(1 / 2.0) end end n = STDIN.gets....
[["-", 0, 751, 15, 738, 12, 652, 486, 739, 0, 24], ["-", 15, 738, 12, 652, 486, 739, 0, 738, 17, 33], ["+", 8, 736, 0, 751, 15, 738, 12, 738, 17, 72], ["-", 0, 751, 15, 738, 12, 652, 486, 739, 0, 25], ["-", 8, 736, 0, 751, 15, 738, 12, 652, 17, 131], ["-", 8, 736, 0, 751, 15, 738, 12, 652, 735, 22], ["-", 0, 269, 8, 73...
4
162
8
n = readline.chomp.to_i n.times do |i| (xa, ya, ra, xb, yb, rb) = file.readline.chomp.split(' ').map(&:to_f) l = Math.sqrt((xb - xa) ** 2 + (yb - ya) ** 2) r = ra + rb if r < l p 0 elsif (ra - rb).abs <= l and l <= ra + rb p 1 else if rb > ra p 2 else p -2 end end end
n = readline.chomp.to_i n.times do |i| (xa, ya, ra, xb, yb, rb) = readline.chomp.split(' ').map(&:to_f) l = Math.sqrt((xb - xa) ** 2 + (yb - ya) ** 2) r = ra + rb if r < l p 0 elsif (ra - rb).abs <= l and l <= ra + rb p 1 else if ra > rb p 2 else p -2 end end end
[["-", 12, 652, 486, 652, 486, 652, 486, 652, 486, 22], ["-", 12, 652, 486, 652, 486, 652, 486, 652, 17, 131], ["-", 75, 759, 75, 95, 0, 121, 15, 738, 31, 22], ["-", 75, 759, 75, 95, 0, 121, 15, 738, 17, 47], ["+", 75, 759, 75, 95, 0, 121, 15, 738, 17, 47], ["+", 75, 759, 75, 95, 0, 121, 15, 738, 12, 22]]
4
111
6
def euclidean_distance(p1, p2) sum_of_squares = 0 p1.each_with_index do |p1_coord, index| sum_of_squares += (p1_coord - p2[index]) ** 2 end Math.sqrt(sum_of_squares) end gets.to_i.times do input = gets.split.map(&:to_f) center_a = input[0..1] radius_a = input[2] center_b = input[3..4] radius_b = ...
def euclidean_distance(p1, p2) sum_of_squares = 0 p1.each_with_index do |p1_coord, index| sum_of_squares += (p1_coord - p2[index]) ** 2 end Math.sqrt(sum_of_squares) end gets.to_i.times do input = gets.split.map(&:to_f) center_a = input[0..1] radius_a = input[2] center_b = input[3..4] radius_b = ...
[["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 62], ["-", 75, 759, 75, 759, 15, 738, 12, 738, 31, 22], ["+", 75, 759, 75, 759, 15, 738, 12, 738, 31, 22], ["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 748, 17, 33], ["+", 64, 749, 0, 652, 3, 4, 0, 748, 439, 612], ["-", 75, 95, 0, 652, 3, 4, 0, 557...
4
133
13
#!/usr/local/bin/ruby n=gets.to_i n.times{ xa,ya,ra,xb,yb,rb=gets.split.map(&:to_f) d=Math.sqrt((ya-xa)**2+(yb-ya)**2) if d < ra-rb puts "2" elsif d < rb-ra puts"-2" elsif d > ra +rb puts"0" else puts "1" end }
#!/usr/local/bin/ruby n=gets.to_i n.times{ xa,ya,ra,xb,yb,rb=gets.split.map(&:to_f) d=Math.sqrt((xb-xa)**2+(yb-ya)**2) if d < ra-rb puts "2" elsif d < rb-ra puts"-2" elsif d > ra +rb puts"0" else puts "1" end }
[["-", 0, 738, 31, 738, 31, 739, 0, 738, 31, 22], ["+", 0, 738, 31, 738, 31, 739, 0, 738, 31, 22]]
4
90
2
def length(xa, ya, xb, yb) Math.sqrt((xa - xb)**2 + (ya - yb)**2) end n = gets.to_i while gets xa, ya, ra, xb, yb, rb = $_.split(' ').map(&:to_f) l = length(xa, ya, xb, yb) if ra > l + rb out = 2 elsif rb > l + ra out = -2 elsif ra + rb == l out = 1 else out = 0 end puts out end
def length(xa, ya, xb, yb) Math.sqrt((xa - xb)**2 + (ya - yb)**2) end n = gets.to_i while gets xa, ya, ra, xb, yb, rb = $_.split(' ').map(&:to_f) l = length(xa, ya, xb, yb) if ra > l + rb out = 2 elsif rb > l + ra out = -2 elsif ra + rb < l out = 0 else out = 1 end puts out end
[["-", 0, 121, 75, 759, 75, 759, 15, 738, 17, 60], ["+", 0, 121, 75, 759, 75, 759, 15, 738, 17, 18], ["-", 75, 759, 75, 759, 64, 749, 0, 662, 12, 612], ["+", 75, 759, 75, 759, 64, 749, 0, 662, 12, 612], ["-", 75, 759, 75, 759, 75, 95, 0, 662, 12, 612], ["+", 75, 759, 75, 759, 75, 95, 0, 662, 12, 612]]
4
113
6
n = gets.to_i n.times do xa, ya, ra, xb, yb, rb = gets.split.map(&:to_f) d = Math.sqrt( (xa - xb) ** 2 - (ya - yb) ** 2 ) if ra > rb + d then puts 2 elsif rb > ra + d then puts -2 elsif d <= ra + rb then puts 1 else puts 0 end end
n = gets.to_i n.times do xa, ya, ra, xb, yb, rb = gets.split.map(&:to_f) d = Math.sqrt( (xa - xb) ** 2 + (ya - yb) ** 2 ) if ra > rb + d then puts 2 elsif rb > ra + d then puts -2 elsif d <= ra + rb then puts 1 else puts 0 end end
[["-", 0, 662, 12, 652, 3, 4, 0, 738, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 738, 17, 72]]
4
85
2
def relation(xa, ya, ra, xb, yb, rb) d = ((xa - xb) ** 2 + (ya - yb) ** 2) ** 0.5 return 0 if ra + rb <= d return 2 if d + rb <= ra return -2 if d + ra <= rb return 1 end $<.gets.to_i.times do p relation(*$<.gets.split.map(&:to_i)) end
def relation(xa, ya, ra, xb, yb, rb) d = ((xa - xb) ** 2 + (ya - yb) ** 2) ** 0.5 return 0 if ra + rb < d return 2 if d + rb < ra return -2 if d + ra < rb return 1 end $<.gets.to_i.times do p relation(*$<.gets.split.map(&:to_f)) end
[["-", 0, 735, 8, 736, 0, 751, 15, 738, 17, 19], ["+", 0, 735, 8, 736, 0, 751, 15, 738, 17, 18], ["-", 0, 741, 0, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 741, 0, 652, 3, 4, 0, 752, 0, 753]]
4
89
8
class Vector attr_accessor :x, :y def initialize(x, y) @x = x @y = y end def length() Math.sqrt(@x**2 + @y**2) end def self.minus(v1, v2) return Vector.new(v1.x - v2.x, v1.y - v2.y) end end if __FILE__ == $0 n = gets.to_i n.times do xa, ya, ra, xb, yb, rb = gets.split.map{|i| ...
class Vector attr_accessor :x, :y def initialize(x, y) @x = x @y = y end def length() Math.sqrt(@x**2 + @y**2) end def self.minus(v1, v2) return Vector.new(v1.x - v2.x, v1.y - v2.y) end end if __FILE__ == $0 n = gets.to_i n.times do xa, ya, ra, xb, yb, rb = gets.split.map{|i| ...
[["-", 196, 737, 8, 736, 0, 121, 15, 738, 17, 19], ["+", 196, 737, 8, 736, 0, 121, 15, 738, 17, 18], ["-", 8, 736, 0, 121, 75, 759, 15, 738, 17, 19], ["+", 8, 736, 0, 121, 75, 759, 15, 738, 17, 18], ["-", 0, 121, 75, 759, 75, 759, 15, 738, 17, 60], ["+", 0, 121, 75, 759, 75, 759, 15, 738, 17, 19]]
4
185
6
import math for i in range(int(input())): xa, ya, ra, xb, yb, rb = list(map(float, input().split())) d1 = (xa - xb) ** 2 + (ya - yb) ** 2 d2 = ra ** 2 + rb ** 2 dr = (ra-rb) ** 2 if d1 <= d2: if dr >= d1: print(2 if ra > rb else -2) else: print(1) else: ...
import math for i in range(int(input())): xa, ya, ra, xb, yb, rb = list(map(float, input().split())) d1 = (xa - xb) ** 2 + (ya - yb) ** 2 d2 = (ra + rb) ** 2 dr = (ra-rb) ** 2 if d1 <= d2: if dr > d1: print(2 if ra > rb else -2) else: print(1) else: ...
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 578], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25], ["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47]]
5
110
6
from fractions import Fraction as F for _ in range(eval(input())): x1, y1, r1, x2, y2, r2 = list(map(F, input().split())) d = (x1+x2)**2+(y1+y2)**2 if d < (r1-r2)**2: print(2 if r1 > r2 else -2) elif (r1-r2)**2 <= d <= (r1+r2)**2: print(1) else: print(0)
from fractions import Fraction as F for _ in range(eval(input())): x1, y1, r1, x2, y2, r2 = list(map(F, input().split())) d = (x1-x2)**2+(y1-y2)**2 if d < (r1-r2)**2: print(2 if r1 > r2 else -2) elif (r1-r2)**2 <= d <= (r1+r2)**2: print(1) else: print(0)
[["-", 12, 657, 31, 657, 31, 23, 0, 657, 17, 72], ["+", 12, 657, 31, 657, 31, 23, 0, 657, 17, 33], ["-", 12, 657, 12, 657, 31, 23, 0, 657, 17, 72], ["+", 12, 657, 12, 657, 31, 23, 0, 657, 17, 33]]
5
114
4
import math def length(xa, ya, xb, yb): return math.sqrt((xa - xb)**2 + (ya - yb)**2) n = int(input()) for s in range(0, n): xa, ya, ra, xb, yb, rb = list(map(float, input().split(' '))) d = length(xa, ya, xb, yb) if ra > rb + d: print(2) elif rb > ra + d: print(-2) elif d < ra + rb: print(0)...
import math def length(xa, ya, xb, yb): return math.sqrt((xa - xb)**2 + (ya - yb)**2) n = int(input()) for s in range(0, n): xa, ya, ra, xb, yb, rb = list(map(float, input().split(' '))) d = length(xa, ya, xb, yb) if ra > rb + d: print(2) elif rb > ra + d: print(-2) elif d > ra + rb: print(0)...
[["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 18], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47]]
5
135
2
(function(input) { var p = input.replace(/\n$/, '').split('\n').map(Number); var n = p.length; var G = 9.8; for (var i = 0; i < n; i++) { var mv = p.shift(); var t = mv / G; var N = (G / 2 * t * t + 5) / 5; console.log(Math.round(N)); } })(require('fs').readFileSync('/dev/stdin', 'utf8'));
(function(input) { var p = input.replace(/\n$/, '').split('\n').map(Number); var n = p.length; var G = 9.8; for (var i = 0; i < n; i++) { var mv = p.shift(); var t = mv / G; var N = (G / 2 * t * t + 5) / 5; console.log(Math.ceil(N)); } })(require('fs').readFileSync('/dev/stdin', 'utf8'));
[["-", 0, 2, 3, 3, 0, 2, 63, 558, 559, 560], ["+", 0, 2, 3, 3, 0, 2, 63, 558, 559, 560]]
2
128
2
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var lines = input.trim().split('\n'); var line; while (line = lines.shift()) { var speed = +line; for (var f = 1; f < 50; f++) { var t = Math.sqrt((f * 5 - 5) / 4.9); var v = 9.8 * t; if (v >= speed) { console.log(f); break; ...
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var lines = input.trim().split('\n'); var line; while (line = lines.shift()) { var speed = +line; for (var f = 1;; f++) { var t = Math.sqrt((f * 5 - 5) / 4.9); var v = 9.8 * t; if (v >= speed) { console.log(f); break; } }...
[["-", 8, 556, 0, 7, 15, 1, 0, 16, 31, 22], ["-", 8, 556, 0, 7, 15, 1, 0, 16, 17, 18], ["-", 8, 556, 0, 7, 15, 1, 0, 16, 12, 555]]
2
116
3
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); String str = ""; while (sc.hasNextLine() == true) { str = sc.nextLine(); double maxv = Double.parseDouble(str); do...
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); String str = ""; while (sc.hasNextLine() == true) { str = sc.nextLine(); double maxv = Double.parseDouble(str); do...
[["+", 49, 200, 51, 16, 31, 74, 51, 492, 500, 22], ["+", 49, 200, 51, 16, 31, 74, 51, 492, 0, 131], ["+", 49, 200, 51, 16, 31, 74, 51, 492, 141, 22]]
3
124
3
import java.util.*; class Main { public static void main(String[] z) { for (Scanner s = new Scanner(System.in); s.hasNext();) System.out.println( (int)Math.ceil(Math.pow(s.nextDouble(), 2) / 19.6 + 5) / 5); } }
import java.util.*; class Main { public static void main(String[] z) { for (Scanner s = new Scanner(System.in); s.hasNext();) System.out.println( (int)Math.ceil((Math.pow(s.nextDouble(), 2) / 19.6 + 5) / 5)); } }
[["+", 51, 492, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 74, 51, 492, 3, 4, 0, 25]]
3
77
2
import java.util.*; class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String out = ""; while (scanner.hasNext()) { double v = scanner.nextDouble(); for (int n = 1;; n++) { double vv = 9.8 * Math.sqrt((5 * n - 5) / 4.9); if (vv >= v...
import java.util.*; class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String out = ""; while (scanner.hasNext()) { double v = scanner.nextDouble(); for (int n = 1;; n++) { double vv = 9.8 * Math.sqrt((5 * n - 5) / 4.9); if (vv >= v...
[["-", 0, 57, 64, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 17, 107]]
3
119
2
#include <stdio.h> int main() { double v, y; unsigned long long int n; while (scanf("%lf", &v) != EOF) { y = v / 19.6 * v; if ((int)y % 5) n = (int)(y / 5) + 2; else n = (int)(y / 5) + 1; printf("%llu\n", n); } return 0; }
#include <stdio.h> int main() { double v, y; unsigned long long int n; while (scanf("%lf", &v) != EOF) { y = v / 19.6 * v; if (y - y / 5) n = (int)(y / 5) + 2; else n = (int)(y / 5) + 1; printf("%llu\n", n); } return 0; }
[["-", 0, 57, 15, 23, 0, 16, 31, 74, 0, 24], ["-", 15, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 23, 0, 16, 31, 74, 0, 25], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 109], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 33], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 85]]
0
92
6
#include <stdio.h> int main() { double v, y; unsigned long long int n; while (scanf("%lf", &v) != EOF) { y = v / 19.6 * v; if ((int)y % 5) n = (int)(y / 5) + 2; else n = (int)(y / 5) + 1; printf("%llu\n", n); } return 0; }
#include <stdio.h> int main() { double v, y; unsigned long long int n; while (scanf("%lf", &v) != EOF) { y = v / 19.6 * v; if (y - (int)y / 5) n = (int)(y / 5) + 2; else n = (int)(y / 5) + 1; printf("%llu\n", n); } return 0; }
[["+", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 33], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 109], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 85]]
0
92
6
#include <stdio.h> int main() { double v, y; unsigned long long int n; while (scanf("%lf", &v) != EOF) { y = v / 19.6 * v; if ((int)y % 5) n = (int)(y / 5) + 2; else n = (int)(y / 5) + 1; printf("%llu\n", n); } return 0; }
#include <stdio.h> int main() { double v, y; unsigned long long int n; while (scanf("%lf", &v) != EOF) { y = v / 19.6 * v; if (y - (int)y / 5 * 5) n = (int)(y / 5) + 2; else n = (int)(y / 5) + 1; printf("%llu\n", n); } return 0; }
[["+", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 33], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 109], ["+", 15, 23, 0, 16, 12, 16, 31, 16, 17, 85], ["+", 15, 23, 0, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 48]]
0
92
6
#include <math.h> #include <stdio.h> int main(void) { long long int kai, N; double h, v, t, t2, speed; while (scanf("%lf", &speed) != EOF) { for (N = 1;; N++) { kai = 5 * N; h = kai - 5; t2 = h / 4.9; t = sqrt(t2); v = 9.8 * t; if (v > speed) break; } printf...
#include <math.h> #include <stdio.h> int main(void) { long long int kai, N; double h, v, t, t2, speed; while (scanf("%lf", &speed) != EOF) { for (N = 1;; N++) { kai = 5 * N; h = kai - 5; t2 = h / 4.9; t = sqrt(t2); v = 9.8 * t; if (v > speed) break; } printf...
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
108
1
#include <stdio.h> int main(void) { int i, max = 0; double v[50]; for (i = 0; i < 50; i++) { int ret = scanf("%lf", &v[i]); if (ret == EOF) break; if (i > max) max = i; } int N[50]; double t[50], t2[50], y[50], n[50]; for (i = 0; i <= max; i++) { t[i] = v[i] / 9.8; t2[i] = ...
#include <stdio.h> int main(void) { int i, max = 0; double v[50]; for (i = 0; i < 50; i++) { int ret = scanf("%lf", &v[i]); if (ret == EOF) break; if (i > max) max = i; } int N[50]; double t[50], t2[50], y[50], n[50]; for (i = 0; i <= max; i++) { t[i] = v[i] / 9.8; t2[i] = ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
0
196
2
#include <stdio.h> main() { double v, nv, t; int n, i; while (1) { if (scanf("%lf", &nv) == EOF) break; nv = nv * nv; for (i = 1;; i++) { t = ((double)i - 1.0) * 5.0 / 4.9; v = 9.8 * 9.8 * t; if (v >= nv) { printf("%d", i); break; } } } return 0;...
#include <stdio.h> main() { double v, nv, t; int n, i; while (1) { if (scanf("%lf", &nv) == EOF) break; nv = nv * nv; for (i = 1;; i++) { t = ((double)i - 1.0) * 5.0 / 4.9; v = 9.8 * 9.8 * t; if (v >= nv) { printf("%d\n", i); break; } } } return ...
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
105
1
float v; main() { for (; ~scanf("%f", &v);) printf("%g\n", v * v / 98 + 2); }
float v; main(i) { for (; ~scanf("%f", &v);) printf("%d\n", i = v * v / 98 + 2); }
[["+", 36, 36, 0, 30, 0, 14, 49, 65, 0, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 11, 31, 22], ["+", 8, 1, 0, 2, 3, 4, 0, 11, 17, 32]]
0
40
6
#include <stdio.h> int main(int argc, const char *argv[]) { float value; double y, t; int n; while (scanf("%f", &value) != EOF) { t = 0.0; n = 0; t = value / 9.8; y = 4.9 * t * t; n = (y + 5) / 5; printf("b%d\n", n + 1); } return 0; }
#include <stdio.h> int main(int argc, const char *argv[]) { float value; double y, t; int n; while (scanf("%f", &value) != EOF) { t = 0.0; n = 0; t = value / 9.8; y = 4.9 * t * t; n = (y + 5) / 5; printf("%d\n", n + 1); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
91
2
int main(void) { float b; int i; while (~scanf("%f", &b)) { b *= b / 98; i = 0; // while(++i-1<b); printf("%d\n", i = b + 1); } return (0); }
int main(void) { float b; int i; while (~scanf("%f", &b)) { b *= b / 98; i = 0; // while(++i<=b+1); printf("%d\n", i = b + 2); } return (0); }
[["-", 0, 2, 3, 4, 0, 11, 12, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 11, 12, 16, 12, 13]]
0
58
2
i; main(float b) { for (; i = ~scanf("%f", &b);) printf("%.f\n", b * b / 98 + 2); }
i; main(float b) { for (; i = ~scanf("%f", &b);) printf("%d\n", i = b / 98 * b + 2); }
[["-", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 3, 4, 0, 16, 31, 16, 31, 16, 31, 22], ["-", 3, 4, 0, 16, 31, 16, 31, 16, 17, 48], ["+", 8, 1, 0, 2, 3, 4, 0, 11, 31, 22], ["+", 8, 1, 0, 2, 3, 4, 0, 11, 17, 32], ["+", 3, 4, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 3, 4, 0, 11, 12, 16, 31, 16...
0
43
8
#include <stdio.h> int main(void) { int n; double y, v; while (1) { int c = scanf("%lf", &v); if (c == EOF) return 0; y = 4.9 * (v / 9.8) * (v / 9.8); n = 0; while (1) { if (5 * n - 5.5 >= y) break; n++; } printf("%d\n", n); } return 0; }
#include <stdio.h> int main(void) { int n; double y, v; while (1) { int c = scanf("%lf", &v); if (c == EOF) return 0; y = 4.9 * (v / 9.8) * (v / 9.8); n = 0; while (1) { if (5 * n - 5 >= y) break; n++; } printf("%d\n", n); } return 0; }
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 12, 13]]
0
99
2
#include <stdio.h> int main() { double n, t, v, y; while (scanf("%lf", &v) != EOF) { t = v / 9.8; y = 4.9 * t * t; n = (y + 5) / 5; printf("%.0lf\n", n); } return 0; }
#include <stdio.h> int main() { double n, t, v, y; while (scanf("%lf", &v) != EOF) { t = v / 9.8; y = 4.9 * t * t; n = (y + 5) / 5; printf("%.0lf\n", n + .5); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
0
70
2
#include <math.h> #include <stdio.h> int main() { float v; while (scanf("%f", &v) != EOF) printf("%.f\n", ceil(v * v / 98) / 5 + 1); return 0; }
#include <math.h> #include <stdio.h> int main() { float v; while (scanf("%f", &v) != EOF) printf("%.f\n", ceil(v * v / 98) + 1); return 0; }
[["-", 0, 2, 3, 4, 0, 16, 31, 16, 17, 85], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13]]
0
51
2
#include <math.h> #include <stdio.h> int main() { int i, n; double v, t, y; while (scanf("%lf", &v) != EOF) { t = v / 9.8; y = 4, 8 * t * t; n = (int)ceil(((y + 5) / 5)); printf("%d\n", n); } return 0; }
#include <math.h> #include <stdio.h> int main() { int i, n; double v, t, y; while (scanf("%lf", &v) != EOF) { t = v / 9.8; y = 4.9 * t * t; n = (int)ceil(((y + 5.0) / 5.0)); printf("%d\n", n); } return 0; }
[["-", 8, 9, 0, 1, 0, 34, 31, 11, 12, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 34, 0, 21], ["-", 0, 1, 0, 34, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["-", 0, 23, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 23, 0, 16, 31, 23, 0, 16, 12, 13], ["-", 51, 2, 3, 4, 0, 23, 0, 16, 12, 13], ["+", 51, 2, 3, 4, ...
0
85
8
#include <stdio.h> int main() { double v, h, n; int i; while (scanf("%lf", &v) != EOF) { h = v * v / 19.6; i = 1; n = 0.0; while (1) { i++; if (n < h && (n + (double)(5 * (i - 1))) >= h) { printf("%d\n", i); break; } n += (double)(5 * (i - 1)); } } ...
#include <stdio.h> int main() { double v, h, n; int i; while (scanf("%lf", &v) != EOF) { h = v * v / 19.6; i = 1; n = 0.0; while (1) { i++; if (n < h && (double)(5 * (i - 1)) >= h) { printf("%d\n", i); break; } n = (double)(5 * (i - 1)); } } retur...
[["-", 0, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["-", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["-", 12, 16, 31, 23, 0, 16, 12, 74, 0, 24], ["-", 12, 74, 51, 23, 0, 16, 12, 23, 0, 25], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32]]
0
116
6
#include <math.h> #include <stdio.h> int main() { double m, t, n; while (scanf("%lf", &m) != EOF) { t = m / 9.8; n = (4.9 * t * t + 5.0) / 5.0; printf("%d\n", ceil(n)); } return 0; }
#include <math.h> #include <stdio.h> int main() { double m, t, n; while (scanf("%lf", &m) != EOF) { t = m / 9.8; n = (4.9 * t * t + 5.0) / 5.0; printf("%d\n", (int)ceil(n)); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 74, 0, 24], ["+", 0, 2, 3, 4, 0, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 2, 3, 4, 0, 74, 0, 25]]
0
69
3
#include <math.h> #include <stdio.h> int main(void) { double v, y; int n; while (scanf("%lf", &v) != EOF) { /* v = 9.8 * t y = 4.9 * t^2 より y = 4.9 * (v / 9.8)^2 */ y = 4.9 * pow((v / 9.8), 2); /* 建物のN階の高さが 5 * N - 5 より N = (y + 5) / 5 */ n = ceil((y + 5) / 5); p...
#include <math.h> #include <stdio.h> int main(void) { double v, y; int n; while (scanf("%lf", &v) != EOF) { /* v = 9.8 * t y = 4.9 * t^2 より y = 4.9 * (v / 9.8)^2 */ y = 4.9 * pow((v / 9.8), 2); /* 建物のN階の高さYが Y = 5 * N - 5 より N = (Y + 5) / 5 */ n = (int)ceil((y + 5) /...
[["+", 8, 9, 0, 1, 0, 11, 12, 74, 0, 24], ["+", 0, 1, 0, 11, 12, 74, 39, 77, 39, 40], ["+", 8, 9, 0, 1, 0, 11, 12, 74, 0, 25], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
77
4
#include <stdio.h> int main() { double v, y; double N; int n; while (scanf("%lf", &v) != EOF) { y = 4.9 * (v / 9.8) * (v / 9.8); N = (y + 5) / 5; n = (y + 5) / 5; if (n < N) n++; printf("%d", n); } return 0; }
#include <stdio.h> int main() { double v, y; double N; int n; while (scanf("%lf", &v) != EOF) { y = 4.9 * (v / 9.8) * (v / 9.8); N = (y + 5) / 5; n = (y + 5) / 5; if (n < N) n++; printf("%d\n", n); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
92
1
#include <math.h> #include <stdio.h> #define GRAVITY_ACC 9.8 #define GRAVITY_AC 4.9 main() { double velocity = 0; //入力される速度 double time = 0, distance = 0, result = 0; // t, y, nに対応 int n = 0; while (scanf("%lf", &velocity) != EOF) { time = velocity / GRAVITY_ACC; // tの計算 distance...
#include <math.h> #include <stdio.h> #define GRAVITY_ACC 9.8 #define GRAVITY_AC 4.9 main() { double velocity = 0; //入力される速度 double time = 0, distance = 0, result = 0; // t, y, nに対応 int n = 0; while (scanf("%lf", &velocity) != EOF) { time = velocity / GRAVITY_ACC; // tの計算 distance...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
0
104
2
#include <cmath> #include <iostream> #define REP(i, s, n) for (int i = 0; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; int main() { long double n; cin >> n; // cout << n*n/19.6<<endl; // cout << int(35.0+1.2)<<endl; cout << int(n * n / 19.6 / 5 + 2) << endl; return 0; }
#include <cmath> #include <iostream> #define REP(i, s, n) for (int i = 0; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; int main() { long double n; // cout << n*n/19.6<<endl; // cout << int(35.0+1.2)<<endl; while (cin >> n) { cout << int(n * n / 19.6 / 5 + 2) << endl; } return 0; }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
62
6
#include <iostream> using namespace std; int main(void) { double v; double t; //球が割れるのに必要な最低速度になるのは落下し始めてから何秒後か int y; // t秒後に物体が落下した距離 int N; //球が割れる建物の階の最小値 while (cin >> v) { t = v / 9.8; y = 4.9 * t * t; N = ((y + 1) + 5) / 5; cout << N + 1 << endl; } }
#include <iostream> using namespace std; int main(void) { double v; double t; //球が割れるのに必要な最低速度になるのは落下し始めてから何秒後か double y; // t秒後に物体が落下した距離 int N; //球が割れる建物の階の最小値 while (cin >> v) { t = v / 9.8; y = 4.9 * t * t; N = (y + 5) / 5; cout << N + 1 << endl; } }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["-", 31, 23, 0, 16, 31, 23, 0, 16, 17, 72], ["-", 31, 23, 0, 16, 31, 23, 0, 16, 12, 13], ["-", 12, 16, 31, 23, 0, 16, 31, 23, 0, 25]]
1
72
6
#include <math.h> #include <stdio.h> double dist(double x1, double y1, double x2, double y2) { // return (pow(x1 - x2, 2) + pow(y1 - y2, 2)); return (hypot(x1 - x2, y1 - y2)); } int main(void) { double ax, ay; double bx, by; double ar, br; double abdist; int n, i; scanf("%d", &n); for (i = 0; i < n...
#include <math.h> #include <stdio.h> double dist(double x1, double y1, double x2, double y2) { // return (pow(x1 - x2, 2) + pow(y1 - y2, 2)); return (hypot(x1 - x2, y1 - y2)); } int main(void) { double ax, ay; double bx, by; double ar, br; double abdist; int n, i; scanf("%d", &n); for (i = 0; i < n...
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 106], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 72]]
0
201
6
#include <math.h> #include <stdio.h> #define sq(x) (x) * (x) int main(void) { int n, i; double xa, ya, ra, xb, yb, rb; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb); if ((sq(xa - xb) + sq(ya - yb)) < sq(rb - ra)) { if (ra > rb) { ...
#include <math.h> #include <stdio.h> #define sq(x) (x) * (x) int main(void) { int n, i; double xa, ya, ra, xb, yb, rb; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb); if ((sq(xa - xb) + sq(ya - yb)) < sq(rb - ra)) { if (ra > rb) { ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 117]]
0
194
6
#include <math.h> #include <stdio.h> int main(void) { int n; double xa, ya, ra, xb, yb, rb, dis; scanf("%d", &n); while (n-- > 0) { scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb); dis = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); if (dis + ra < rb) { puts("2"); } ...
#include <math.h> #include <stdio.h> int main(void) { int n; double xa, ya, ra, xb, yb, rb, dis; scanf("%d", &n); while (n-- > 0) { scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb); dis = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); if (dis + ra < rb) { puts("-2"); } ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 75, 76, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 23, 0, 16, 17, 20]]
0
168
6
#include <math.h> #include <stdio.h> #define FALSE 0 #define CROSS 1 #define A_IN_B -2 #define B_IN_A 2 #define OTHER -10 #define compile 0 struct circle { double x; //中心のx座標 double y; //中心のy座標 double r; //円の半径 }; int func_judge(double ax, double ay, double ar, double bx, double by, double br);...
#include <math.h> #include <stdio.h> #define FALSE 0 #define CROSS 1 #define A_IN_B -2 #define B_IN_A 2 #define OTHER -10 #define compile 0 struct circle { double x; //中心のx座標 double y; //中心のy座標 double r; //円の半径 }; int func_judge(double ax, double ay, double ar, double bx, double by, double br);...
[["-", 0, 11, 12, 2, 3, 4, 0, 118, 119, 120], ["+", 0, 11, 12, 2, 3, 4, 0, 118, 119, 120]]
0
386
2
#include <iostream> #include <math.h> #include <stdio.h> #include <string.h> using namespace std; double dis(long double x1, long double y1, long double x2, long double y2); int main() { long double x1, y1, r1; long double x2, y2, r2; long double ans; double r[2]; int n; cin >> n; for (int i = 0; i < n...
#include <iostream> #include <math.h> #include <stdio.h> #include <string.h> using namespace std; double dis(long double x1, long double y1, long double x2, long double y2); int main() { long double x1, y1, r1; long double x2, y2, r2; long double ans; double r[2]; int n; cin >> n; for (int i = 0; i < n...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
243
2
#include <iostream> #include <math.h> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { double xa, ya, ra, xb, yb, rb, l; cin >> xa >> ya >> ra >> xb >> yb >> rb; l = sqrt(pow((xa - xb), 2) + pow((ya - yb), 2)); if (l > ra + rb) cout << 0 << endl; else if...
#include <iostream> #include <math.h> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { double xa, ya, ra, xb, yb, rb, l; cin >> xa >> ya >> ra >> xb >> yb >> rb; l = sqrt(pow((xa - xb), 2) + pow((ya - yb), 2)); if (l > ra + rb) cout << 0 << endl; else if...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47]]
1
147
2
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstr...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstr...
[["-", 15, 339, 51, 16, 12, 16, 12, 118, 28, 22], ["+", 15, 339, 51, 16, 12, 16, 12, 118, 28, 22]]
1
1,331
2
#include <cmath> #include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { double xa, ya, ra, xb, yb, rb; cin >> xa >> ya >> ra >> xb >> yb >> rb; double dis = sqrt(pow((xa - xb), 2) - pow((ya - yb), 2)); if (fabs(ra - rb) >= dis) if (ra > rb) ...
#include <cmath> #include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { double xa, ya, ra, xb, yb, rb; cin >> xa >> ya >> ra >> xb >> yb >> rb; double dis = sqrt(pow((xa - xb), 2) + pow((ya - yb), 2)); if (fabs(ra - rb) > dis) if (ra > rb) ...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 72], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["...
1
161
8
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vii; #define rrep(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define erep(i, m, n) for (int(i) = (m); (i) <= (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) <...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vii; #define rrep(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define erep(i, m, n) for (int(i) = (m); (i) <= (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) <...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
962
2
#include <array> #include <iostream> #include <math.h> int main() { std::array<double, 3> a; // 0:xa 1:ya 2:ra std::array<double, 3> b; int N; std::cin >> N; for (int i = 0; i < N; ++i) { for (int j = 0; j < 3; ++j) std::cin >> a[j]; for (int j = 0; j < 3; ++j) std::cin >> b[j]; ...
#include <array> #include <iostream> #include <math.h> int main() { std::array<double, 3> a; // 0:xa 1:ya 2:ra std::array<double, 3> b; int N; std::cin >> N; for (int i = 0; i < N; ++i) { for (int j = 0; j < 3; ++j) std::cin >> a[j]; for (int j = 0; j < 3; ++j) std::cin >> b[j]; ...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 17, 48], ["+", 51, 2, 3, 4, 0, 23, 0, 16, 17, 33], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["-", 3, 4, 0, 16, 12, 23, 0, 16, 17, 48]]
1
224
8
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main() { double xa, ya, ra, xb, yb, rb; double ab; int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> xa >> ya >> ra >> xb >> yb >> ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main() { double xa, ya, ra, xb, yb, rb; double ab; int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> xa >> ya >> ra >> xb >> yb >> ...
[["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25]]
1
162
4
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { int n; cin >> n; while (n--) { double xa, ya, ra, xb, yb, rb; cin >> xa >> ya >> ra >> xb >> yb >> rb; double dist = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); int ans; if (ra > dist + rb) ...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { int n; cin >> n; while (n--) { double xa, ya, ra, xb, yb, rb; cin >> xa >> ya >> ra >> xb >> yb >> rb; double dist = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); int ans; if (ra > dist + rb) ...
[["-", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13]]
1
139
2
#include <cmath> #include <iostream> using namespace std; struct Circle { long double x, y, r; }; int solve(Circle c, Circle d) { long double dist = (c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y); dist = sqrt(dist); long double dist2 = d.r + dist; if (dist2 < c.r) { return 2; } long double dist...
#include <cmath> #include <iostream> using namespace std; struct Circle { long double x, y, r; }; int solve(Circle c, Circle d) { long double dist = (c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y); dist = sqrt(dist); long double dist2 = d.r + dist; if (dist2 < c.r) { return 2; } long double dist...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
225
4
#include <cmath> #include <iostream> using namespace std; int main() { int n, ans; float x1, y1, r1, x2, y2, r2, dis; cin >> n; for (int i = 0; i < n; i++) { cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2; dis = hypot(x2 - x1, y2 - y1); ans = 0; if (dis < r2 - r1) { ans = 2; } else if (di...
#include <cmath> #include <iostream> using namespace std; int main() { int n, ans; double x1, y1, r1, x2, y2, r2, dis; cin >> n; for (int i = 0; i < n; i++) { cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2; dis = hypot(x2 - x1, y2 - y1); ans = 0; if (dis < r1 - r2) { ans = 2; } else if (d...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
138
10
#include <bits/stdc++.h> using namespace std; using db = double; const db eps = 1e-12; int sgn(db a, db b = 0) { a -= b; return (a > eps) - (a < -eps); } struct poi { db x, y; void r() { cin >> x >> y; } poi operator-(poi p) { return {x - p.x, y - p.y}; } db len() { return sqrt(x * x + y * y); } }; int m...
#include <bits/stdc++.h> using namespace std; using db = double; const db eps = 1e-12; int sgn(db a, db b = 0) { a -= b; return (a > eps) - (a < -eps); } struct poi { db x, y; void r() { cin >> x >> y; } poi operator-(poi p) { return {x - p.x, y - p.y}; } db len() { return sqrt(x * x + y * y); } }; int m...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20]]
1
269
6
#include <cmath> #include <iostream> using namespace std; int check(double xa, double ya, double ra, double xb, double yb, double rb) { double dist = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); double minr = min(ra, rb); if (ra + rb < dist) { return 0; } else { if (ra > rb && dist < rb) { ...
#include <cmath> #include <iostream> using namespace std; int check(double xa, double ya, double ra, double xb, double yb, double rb) { double dist = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); double minr = min(ra, rb); if (ra + rb < dist) { return 0; } else { if (ra > rb && dist < ra - rb) ...
[["+", 15, 339, 51, 16, 12, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 17, 33]]
1
199
4
#include <cmath> #include <iostream> int main() { int n; std::cin >> n; for (int i = 0; i < n; i++) { long double xa, ya, ra, xb, yb, rb; std::cin >> xa >> ya >> ra >> xb >> yb >> rb; long double d = hypot(xa - xb, ya - yb); if (d < abs(ra - rb)) { std::cout << 2 * (ra < rb ? -1 : 1) << std:...
#include <cmath> #include <iostream> int main() { int n; std::cin >> n; for (int i = 0; i < n; i++) { long double xa, ya, ra, xb, yb, rb; std::cin >> xa >> ya >> ra >> xb >> yb >> rb; long double d = hypot(xa - xb, ya - yb); if (d < std::abs(ra - rb)) { std::cout << 2 * (ra < rb ? -1 : 1) <<...
[["+", 15, 339, 51, 16, 12, 2, 63, 343, 345, 348], ["+", 15, 339, 51, 16, 12, 2, 63, 343, 0, 349]]
1
150
2
#include <cmath> #include <iostream> using namespace std; int main() { int n; cin >> n; while (n--) { double xa, ya, ra, xb, yb, rb; cin >> xa >> ya >> ra >> xb >> yb >> rb; double d = hypot(xa - xb, yb - yb); int res = 1; if (ra > rb) { if (d <= ra - rb) res = 2; else if (...
#include <cmath> #include <iostream> using namespace std; int main() { int n; cin >> n; while (n--) { double xa, ya, ra, xb, yb, rb; cin >> xa >> ya >> ra >> xb >> yb >> rb; double d = hypot(xa - xb, ya - yb); int res = 1; if (ra > rb) { if (d < ra - rb) res = 2; else if (d...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 31, 22], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 31, 22], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
144
6
#include <iostream> #include <math.h> using namespace std; int main() { double x1, x2, y1, y2, r1, r2, d; int n, i; cin >> n; for (i = 0; i < n; i++) { cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2; d = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); if (d - r1 - r2 > 0.0) cout << "0" << ...
#include <iostream> #include <math.h> using namespace std; int main() { double x1, x2, y1, y2, r1, r2, d; int n, i; cin >> n; for (i = 0; i < n; i++) { cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2; d = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); if (d - r1 - r2 > 0.0) cout << "0" << ...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47]]
1
161
2
#include <cmath> #include <iostream> enum JudgeCircleIntersect { BinA = 2, AinB = -2, AcrossB = 1, AdisB = 0, Error = -1 }; struct Circle { Circle() {} Circle(double sx, double sy, double sr) : cx(sx), cy(sy), r(sr) {} double cx; double cy; double r; }; double Abs(double x) { return x >= 0 ? ...
#include <cmath> #include <iostream> enum JudgeCircleIntersect { BinA = 2, AinB = -2, AcrossB = 1, AdisB = 0, Error = -1 }; struct Circle { Circle() {} Circle(double sx, double sy, double sr) : cx(sx), cy(sy), r(sr) {} double cx; double cy; double r; }; double Abs(double x) { return x >= 0 ? ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 15, 339, 51, 16, 12, 23, 0, 16, 17, 60], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 20]]
1
371
6
#include <math.h> #include <stdio.h> int main() { int n, x; double xa, ya, ra, xb, yb, rb, d; scanf("%d", &n); for (x = 0; x < n; x++) { scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb); d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); if (ra + rb < d) { printf("0\n")...
#include <math.h> #include <stdio.h> int main() { int n, x; double xa, ya, ra, xb, yb, rb, d; scanf("%d", &n); for (x = 0; x < n; x++) { scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb); d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); if (ra + rb < d) { printf("0\n")...
[["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
187
2