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
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; dou...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; dou...
[["-", 0, 16, 31, 16, 31, 492, 3, 4, 0, 22], ["+", 0, 16, 31, 16, 31, 492, 3, 4, 0, 22]]
3
448
2
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x1, x2, x3, y1, y2, y3, ax, by, g1, g2, g3; while (sc.hasNext()) { x1 = sc.nextDouble(); y1 = sc.nextDouble(); x2 = sc.nextDouble(); y2 = sc.nextDouble(); ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x1, x2, x3, y1, y2, y3, ax, by, g1, g2, g3; while (sc.hasNext()) { x1 = sc.nextDouble(); y1 = sc.nextDouble(); x2 = sc.nextDouble(); y2 = sc.nextDouble(); ...
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["-", 12, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 12, 22]]
3
267
12
#include <math.h> #include <stdio.h> int main(void) { double x1, y1, x2, y2, x3, y3; double px, py; double s, ps1, ps2, ps3; double ep = 0.0001; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py) != EOF) { s = fabs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 ...
#include <math.h> #include <stdio.h> int main(void) { double x1, y1, x2, y2, x3, y3; double px, py; double s, ps1, ps2, ps3; double ep = 0.0001; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py) != EOF) { s = fabs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 ...
[["-", 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], ["-", 15, 23, 0, 16, 31, 74, 51, 2, 63, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 2, 63, 22]]
0
250
5
#include <stdio.h> int a(double A, double a, double B, double b, double x, double y) { if (A != B) { return ((a - b) / (A - B)) * (x - A) + a - y; } else { return x - A; } } int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp; int i, j; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &...
#include <stdio.h> double a(double A, double a, double B, double b, double x, double y) { if (A != B) { return ((a - b) / (A - B)) * (x - A) + a - y; } else { return x - A; } } int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp; int i, j; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40]]
0
260
2
#include <math.h> #include <stdio.h> #define DBL(a) ((a) * (a)) #define EPS 1e-8 int main() { char buf[256]; double x1, y1, x2, y2, x3, y3, xp, yp; double s, a, b, c, p1, p2, p3; double sur[4]; int i; while (fgets(buf, 256, stdin)) { sscanf(buf, "%lf%lf%lf%lf%lf%lf%lf%lf", &x3, &y1, &x2, &y2, &x3, &y3...
#include <math.h> #include <stdio.h> #define DBL(a) ((a) * (a)) #define EPS 1e-8 int main() { char buf[256]; double x1, y1, x2, y2, x3, y3, xp, yp; double s, a, b, c, p1, p2, p3; double sur[4]; int i; while (fgets(buf, 256, stdin)) { sscanf(buf, "%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3...
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22]]
0
430
2
#include <stdio.h> double CrossProduct3(double x1, double y1, double x2, double y2, double x3, double y3); int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp; double Crs1, Crs2, Crs3; /* ????????§?±??????? */ while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp,...
#include <stdio.h> double CrossProduct3(double x1, double y1, double x2, double y2, double x3, double y3); int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp; double Crs1, Crs2, Crs3; /* ????????§?±??????? */ while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp,...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
0
263
2
#include <stdio.h> int calc(double *base, double *des, double *p) { double a[2] = {des[0] - base[0], des[1] - base[1]}; double b[2] = {p[0] - base[0], p[1] - base[1]}; return a[0] * b[1] - a[1] * b[0]; } int main(void) { double A[2], B[2], C[2], P[2], ans1, ans2, ans3; for (; ~scanf("%lf %lf %lf %lf %lf %lf ...
#include <stdio.h> double calc(double *base, double *des, double *p) { double a[2] = {des[0] - base[0], des[1] - base[1]}; double b[2] = {p[0] - base[0], p[1] - base[1]}; return a[0] * b[1] - a[1] * b[0]; } int main(void) { double A[2], B[2], C[2], P[2], ans1, ans2, ans3; for (; ~scanf("%lf %lf %lf %lf %lf %...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40]]
0
273
2
#include <stdio.h> int main(void) { double x1, x2, x3, xp, y1, y2, y3, yp, key, key12, key23, key13; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) { if (x2 < x1 && x1 < x3) { key = x1; x1 = x2; x2 = key; key = y1; y1 ...
#include <stdio.h> int main(void) { double x1, x2, x3, xp, y1, y2, y3, yp, key, key12, key23, key13; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) { if (x2 < x1 && x1 < x3) { key = x1; x1 = x2; x2 = key; key = y1; y1 ...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72]]
0
586
2
#include <stdio.h> int line(double x1, double y1, double x2, double y2, double *a, double *b); int main() { double ax, ay, bx, by, cx, cy, px, py; double aa, ab, ba, bb, ca, cb; int swch; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &px, &py) != EOF) { if (...
#include <stdio.h> int line(double x1, double y1, double x2, double y2, double *a, double *b); int main() { double ax, ay, bx, by, cx, cy, px, py; double aa, ab, ba, bb, ca, cb; int swch; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &px, &py) != EOF) { swch...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 12, 22]]
0
406
6
// AOJ Volume 0 Problem 0012 #include <math.h> #include <stdio.h> typedef struct { double x1; double y1; double x2; double y2; } LINE; int cross(LINE *l1, LINE *l2) { double ta, tb, tc, td; // ta=(x3-x4)*(y1-y3)+(y3-y4)*(x3-x1) // tb=(x3-x4)*(y2-y3)+(y3-y4)*(x3-x2) // tc=(x1-x2)*(y3-y1)+(y1-y2)*(x1...
// AOJ Volume 0 Problem 0012 #include <math.h> #include <stdio.h> typedef struct { double x1; double y1; double x2; double y2; } LINE; int cross(LINE *l1, LINE *l2) { double ta, tb, tc, td; // ta=(x3-x4)*(y1-y3)+(y3-y4)*(x3-x1) // tb=(x3-x4)*(y2-y3)+(y3-y4)*(x3-x2) // tc=(x1-x2)*(y3-y1)+(y1-y2)*(x1...
[["-", 15, 23, 0, 16, 31, 23, 0, 16, 17, 18], ["+", 15, 23, 0, 16, 31, 23, 0, 16, 17, 19], ["-", 15, 23, 0, 16, 12, 23, 0, 16, 17, 18], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 19], ["-", 0, 11, 12, 2, 3, 4, 0, 66, 28, 22], ["+", 0, 11, 12, 2, 3, 4, 0, 66, 28, 22]]
0
510
6
#include <math.h> #include <stdio.h> int main() { double x[5], y[5], d[9], s, s1, s2; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]) != EOF) { d[0] = sqrt((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1])); d[1] = sqrt((x[2] - x[1]...
#include <math.h> #include <stdio.h> int main() { double x[5], y[5], d[9], s, s1, s2; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]) != EOF) { d[0] = sqrt((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1])); d[1] = sqrt((x[2] - x[1]...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13]]
0
682
4
#include <math.h> #include <stdio.h> #define SQ(x) (x) * (x) #define EPS (1e-10) #define EQ(a, b) (abs((a) - (b)) < EPS) int main(void) { double x[4], y[4], S, s, a, b, c, sum; while (~scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x[1], &y[1], &x[2], &y[2], &x[3], &y[3], &x[0], &y[0])) { sum = ...
#include <math.h> #include <stdio.h> #define SQ(x) (x) * (x) #define EPS (1e-10) #define EQ(a, b) (fabs((a) - (b)) < EPS) int main(void) { double x[4], y[4], S, s, a, b, c, sum; while (~scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x[1], &y[1], &x[2], &y[2], &x[3], &y[3], &x[0], &y[0])) { sum =...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]]
0
664
2
#include <stdio.h> int main() { int ans = 0; float x1, y1, x2, y2, x3, y3, x, y; for (; ~scanf("%f%f%f%f%f%f%f%f", &x1, &y1, &x2, &y2, &x3, &y3, &x, &y);) { if (((x2 - x1) * (y - y1) - (y2 - y1) * (x - x1)) < 0) ans--; else ans++; if (((x3 - x2) * (y - y2) - (y3 - y2) * (x - x2)) < 0) ...
#include <stdio.h> int main() { int ans = 0; float x1, y1, x2, y2, x3, y3, x, y; for (; ~scanf("%f%f%f%f%f%f%f%f", &x1, &y1, &x2, &y2, &x3, &y3, &x, &y);) { ans = 0; if (((x2 - x1) * (y - y1) - (y2 - y1) * (x - x1)) < 0) ans--; else ans++; if (((x3 - x2) * (y - y2) - (y3 - y2) * (x - ...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
0
207
4
#include <stdio.h> #define intersect(x1, y1, x2, y2) \ (((x1 - x2) * (yp - y1) + (y1 - y2) * (x1 - xp)) * \ ((x1 - x2) * (yc - y1) + (y1 - y2) * (x1 - xc)) < \ 0) int main(void) { double x1, y1, x2, y2, x3, y3, ...
#include <stdio.h> #define intersect(x1, y1, x2, y2) \ (((x1 - x2) * (yp - y1) + (y1 - y2) * (x1 - xp)) * \ ((x1 - x2) * (yc - y1) + (y1 - y2) * (x1 - xc)) < \ 0) int main(void) { double x1, y1, x2, y2, x3, y3, ...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
0
161
2
#include <math.h> #include <stdio.h> int S(double a, double b, double c) { double s = (a + b + c) / 2; return sqrt(s * (s - a) * (s - b) * (s - c)); } int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp, a, b, c, xa, xb, xc; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, ...
#include <math.h> #include <stdio.h> double S(double a, double b, double c) { double s = (a + b + c) / 2; return sqrt(s * (s - a) * (s - b) * (s - c)); } int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp, a, b, c, xa, xb, xc; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, ...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40]]
0
328
2
#include <stdio.h> struct point { float x; float y; }; struct point sub(struct point a, struct point b) { struct point ret; ret.x = a.x - b.x; ret.y = a.y - b.y; return ret; } int is_in(struct point a, struct point b, struct point c, struct point p) { struct point ab, bp, bc, cp, ca, ap; float c1, c2...
#include <stdio.h> struct point { float x; float y; }; struct point sub(struct point a, struct point b) { struct point ret; ret.x = a.x - b.x; ret.y = a.y - b.y; return ret; } int is_in(struct point a, struct point b, struct point c, struct point p) { struct point ab, bp, bc, cp, ca, ap; float c1, c2...
[["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
0
405
4
// includes #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include ...
// includes #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include ...
[["-", 31, 16, 12, 23, 0, 16, 12, 69, 28, 22], ["+", 31, 16, 12, 23, 0, 16, 12, 69, 28, 22]]
1
332
2
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <numeric> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; struct vector2D { double x, y; vector2D(double x, double y) { this->x = x; this->y = y;...
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <numeric> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; struct vector2D { double x, y; vector2D(double x, double y) { this->x = x; this->y = y;...
[["-", 0, 37, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 37, 0, 2, 3, 4, 0, 16, 12, 22]]
1
451
2
#include <complex> #include <iostream> #include <vector> using namespace std; typedef complex<double> cd; #define X real() #define Y imag() double dot(cd a, cd b) { return (a * conj(b)).X; } double cross(cd a, cd b) { return -((a * conj(b)).Y); } int main() { double x, y; while (cin >> x >> y) { vector<cd...
#include <complex> #include <iostream> #include <vector> using namespace std; typedef complex<double> cd; #define X real() #define Y imag() double dot(cd a, cd b) { return (a * conj(b)).X; } double cross(cd a, cd b) { return -((a * conj(b)).Y); } int main() { double x, y; while (cin >> x >> y) { vector<cd...
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40]]
1
286
2
#include "bits/stdc++.h" #include <cassert> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(a) (a).begin(), (a).end() #define vi vector<int> #define pb push_back #define INF 999999999 //#define INF (1LL<<59) #define EPS (1e-10) class...
#include "bits/stdc++.h" #include <cassert> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(a) (a).begin(), (a).end() #define vi vector<int> #define pb push_back #define INF 999999999 //#define INF (1LL<<59) #define EPS (1e-10) class...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
918
2
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define swap(a, b) tmp = ver[b], ver[b] = ver[a], ver[a] = tmp; int main() { double x1, y1, x2, y2, x3, y3, xp, yp; double p, q, r; while (cin >> x1 >> ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define swap(a, b) tmp = ver[b], ver[b] = ver[a], ver[a] = tmp; int main() { double x1, y1, x2, y2, x3, y3, xp, yp; double p, q, r; while (cin >> x1 >> ...
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22]]
1
204
6
#include <algorithm> #include <array> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <string> #include <utility> using namespace std; typedef long long Int; #define REP(i, x) for (int i = 0; i < x; ++i) typedef pair<int, int> P; struct point { double x, y; }; ...
#include <algorithm> #include <array> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <string> #include <utility> using namespace std; typedef long long Int; #define REP(i, x) for (int i = 0; i < x; ++i) typedef pair<int, int> P; struct point { double x, y; }; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 47], ["-", 0, 14, 8, 9, 0, 37, 0, 16, 12, 13]]
1
268
4
#include <iostream> using namespace std; typedef struct myvector { double x; double y; } Vector; Vector sub_vector(Vector &a, Vector &b) { Vector ret; ret.x = b.x - a.x; ret.y = b.y - a.y; return ret; } double cross_product(Vector &a, Vector &b) { return a.x * b.y - b.x * a.y; } int main() { Vector A,...
#include <iostream> using namespace std; typedef struct myvector { double x; double y; } Vector; Vector sub_vector(Vector &a, Vector &b) { Vector ret; ret.x = b.x - a.x; ret.y = b.y - a.y; return ret; } double cross_product(Vector &a, Vector &b) { return a.x * b.y - b.x * a.y; } int main() { Vector A,...
[["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 47], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 23, 0, 23, 0, 25]]
1
280
4
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> using namespace std; #define FOR(i, n) for (int i = 0; i < n; i++) #define bit(i) static_cast<bitset<8>>(i) typedef long long ll; typedef unsigned long lo...
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> using namespace std; #define FOR(i, n) for (int i = 0; i < n; i++) #define bit(i) static_cast<bitset<8>>(i) typedef long long ll; typedef unsigned long lo...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 33], ["+", 8, 9, 0, 37, 0, 16, 12, 16, 17, 48]]
1
1,451
2
#include <bits/stdc++.h> using namespace std; namespace geometry { typedef double D; typedef complex<D> P; typedef pair<P, P> S; typedef S L; typedef pair<P, D> C; #define EPS (1e-10) #define EQ(a, b) (abs((a) - (b)) < EPS) #define EQV(a, b) (EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag())) static const in...
#include <bits/stdc++.h> using namespace std; namespace geometry { typedef double D; typedef complex<D> P; typedef pair<P, P> S; typedef S L; typedef pair<P, D> C; #define EPS (1e-10) #define EQ(a, b) (abs((a) - (b)) < EPS) #define EQV(a, b) (EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag())) static const in...
[["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 92], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
2,006
3
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; bool flag; double x1, yt1, x2, y2, x3, y3, xp, yp; double v[3][2]; double inpr(double v...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; bool flag; double x1, yt1, x2, y2, x3, y3, xp, yp; double v[3][2]; double inpr(double v...
[["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
514
4
#include <bits/stdc++.h> using namespace std; class D3 { public: double x; double y; double z; //????????????????????? D3(double x_ = 0.0, double y_ = 0.0, double z_ = 0.0) { x = x_; y = y_; z = z_; } //?????? D3 Cross_product(D3 partner) { D3 ret(y * partner.z - z * partner.y, z * p...
#include <bits/stdc++.h> using namespace std; class D3 { public: double x; double y; double z; //????????????????????? D3(double x_ = 0.0, double y_ = 0.0, double z_ = 0.0) { x = x_; y = y_; z = z_; } //?????? D3 Cross_product(D3 partner) { D3 ret(y * partner.z - z * partner.y, z * p...
[["+", 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], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
795
5
//#define _USE_MATH_DEFINES #include <cmath> #include <iostream> //#include <stdio.h> //#include <stdlib.h> //#include <iomanip> //#include <vector> //#include <string> //#include <algorithm> //#include <functional> //#include <time.h> //#include <sstream> //#include <queue> using namespace std; int main() { doubl...
//#define _USE_MATH_DEFINES #include <cmath> #include <iostream> //#include <stdio.h> //#include <stdlib.h> //#include <iomanip> //#include <vector> //#include <string> //#include <algorithm> //#include <functional> //#include <time.h> //#include <sstream> //#include <queue> using namespace std; int main() { doubl...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 146], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
473
4
#include <math.h> #include <stdio.h> double eps = 1e-10; int main() { double x1, x2, x3, y1, y2, y3, xp, yp; double s, s1, s2, s3; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) { //?????§????¢??????¢??? s = ((x2 - x1) * (y3 - y1) - (y2 - y...
#include <math.h> #include <stdio.h> double eps = 1e-10; int main() { double x1, x2, x3, y1, y2, y3, xp, yp; double s, s1, s2, s3; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) { //?????§????¢??????¢??? s = ((x2 - x1) * (y3 - y1) - (y2 - y...
[["+", 0, 57, 15, 339, 51, 16, 31, 2, 63, 22], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 31, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
261
3
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) range(i, 0, b) #define pb(a) push_back(a) #define all(a) (a).begin(), (a), end() #define debug(x) cout << "debug " << x << endl; using namespace std; double dist(double x1, double y1, double x2, double y2) { return sqrt...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) range(i, 0, b) #define pb(a) push_back(a) #define all(a) (a).begin(), (a), end() #define debug(x) cout << "debug " << x << endl; using namespace std; double dist(double x1, double y1, double x2, double y2) { return sqrt...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
377
2
#include <bits/stdc++.h> using namespace std; typedef struct { double x, y; } vec_t; int main() { double x1, y1, x2, y2, x3, y3, xp, yp; vec_t AB, BC, CA, AP, BP, CP; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp; AB.x = x2 - x1, AB.y = y2 - y1; BC.x = x3 - x2, BC.y = y3 - y2; CA.x = x1 - x3, ...
#include <bits/stdc++.h> using namespace std; typedef struct { double x, y; } vec_t; int main() { double x1, y1, x2, y2, x3, y3, xp, yp; vec_t AB, BC, CA, AP, BP, CP; while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) { AB.x = x2 - x1, AB.y = y2 - y1; BC.x = x3 - x2, BC.y = y3 - y2; C...
[["+", 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
274
6
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include ...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 147], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
464
4
#include <iostream> using namespace std; int main(void) { double x[3] = {0, 0, 0}; double y[3] = {0, 0, 0}; double xp = 0, yp = 0; int flag[3] = {0, 0, 0}; while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) { for (int i = 0; i < 3; i++) { int temp1 = (i + 1) % 3; int te...
#include <iostream> using namespace std; int main(void) { double x[3] = {0, 0, 0}; double y[3] = {0, 0, 0}; double xp = 0, yp = 0; int flag[3] = {0, 0, 0}; while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) { for (int i = 0; i < 3; i++) { int temp1 = (i + 1) % 3; int te...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33]]
1
323
4
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define vi vector<int> #define vvi vector<vector<int>> #define ll long long int #define vl vector<ll> #def...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define vi vector<int> #define vvi vector<vector<int>> #define ll long long int #define vl vector<ll> #def...
[["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 47], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 51, 16, 12, 23, 0, 16, 12, 16, 17, 18], ["+", 51, 16, 12, 23, 0, 16, 12, 16, 12, 13]]
1
670
4
#include <iostream> using namespace std; struct TCoordinate { double x; double y; }; double GetCrossProduct(const TCoordinate &V1, const TCoordinate &V2) { return V1.x * V2.y - V1.y * V2.x; } bool IsSameSide(const TCoordinate &T1, const TCoordinate &T2, const TCoordinate &L1, const TCoordinate ...
#include <iostream> using namespace std; struct TCoordinate { double x; double y; }; double GetCrossProduct(const TCoordinate &V1, const TCoordinate &V2) { return V1.x * V2.y - V1.y * V2.x; } bool IsSameSide(const TCoordinate &T1, const TCoordinate &T2, const TCoordinate &L1, const TCoordinate ...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]]
1
302
28
#include <cassert> #include <iostream> int f(int x) { return x * x; } int main() { while (true) { int d; std::cin >> d; if (std::cin.eof()) break; int s = 0; for (int x = d; x < 600; x += d) { s += d * f(x); } std::cout << s; } return 0; }
#include <cassert> #include <iostream> int f(int x) { return x * x; } int main() { while (true) { int d; std::cin >> d; if (std::cin.eof()) break; int s = 0; for (int x = d; x < 600; x += d) { s += d * f(x); } std::cout << s << std::endl; ; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 12, 343, 345, 348], ["+", 8, 9, 0, 1, 0, 16, 12, 343, 0, 349], ["+", 8, 9, 0, 1, 0, 16, 12, 343, 141, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
90
5
#include <iostream> #include <math.h> #include <stdio.h> #include <string.h> using namespace std; #define MAX 256 #define S(x) (x * x) int f(int z) { if (z < 10) return 1; return 1 + f(z / 10); } int main(void) { int ans[MAX]; for (int i = 0; i < MAX; i++) { ans[i] = 0; } int d; int i = 0; ...
#include <iostream> #include <math.h> #include <stdio.h> #include <string.h> using namespace std; #define MAX 256 #define S(x) (x * x) int f(int z) { if (z < 10) return 1; return 1 + f(z / 10); } int main(void) { int ans[MAX]; for (int i = 0; i < MAX; i++) { ans[i] = 0; } int d; int i = 0; ...
[["-", 0, 11, 12, 16, 31, 2, 3, 4, 0, 22], ["+", 0, 11, 12, 16, 31, 2, 3, 4, 0, 22]]
1
174
2
#include <iostream> using namespace std; int main() { int N; while (cin >> N) { int count = 0; for (int i = 0; i < 600 / N - 1; i++) { count += N * (N + i * N) * (N + i * N); } cout << count; } return 0; }
#include <iostream> using namespace std; int main() { int N; while (cin >> N) { int count = 0; for (int i = 0; i < 600 / N - 1; i++) { count += N * (N + i * N) * (N + i * N); } cout << count << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
75
2
#include <cmath> #include <iostream> using namespace std; int main(void) { int n, res; double buf; while (cin >> n) { res = 0; for (int i = 0; i <= 600 - n; i += n) { res += pow(i, 2) * n; } cout << res; } return 0; }
#include <cmath> #include <iostream> using namespace std; int main(void) { int n, res; double buf; while (cin >> n) { res = 0; for (int i = 0; i <= 600 - n; i += n) { res += pow(i, 2) * n; } cout << res << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
72
2
#include <stdio.h> int main() { int n, ans, i; while (scanf("%d", &n) != EOF) { ans = 0; for (i = 1; i * n < 600; i++) ans += (i * n) * (i * n); printf("%d\n", ans * (60 / i)); } }
#include <stdio.h> int main() { int n, ans, i; while (scanf("%d", &n) != EOF) { ans = 0; for (i = 1; i * n < 600; i++) ans += (i * n) * (i * n); printf("%d\n", ans * (600 / i)); } }
[["-", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13]]
1
80
2
#include <cstdio> #include <iostream> #define N 600 double f(double x) { return x * x; } int main(void) { int d, i; double sum; while (std::cin >> d) { sum = 0; for (int i = d; i < N; i += d) { sum += f(i) * d; } std::cout << sum << std::endl; } return 0; }
#include <cstdio> #include <iostream> #define N 600 int f(int x) { return x * x; } int main(void) { int d, i; int sum; while (std::cin >> d) { sum = 0; for (int i = d; i < N; i += d) { sum += f(i) * d; } std::cout << sum << std::endl; } return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
88
6
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { double area = 0; for (int i = d; i <= 600 - d; i += d) { area += i * i * d; } cout << area << endl; } return 0; }
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int area = 0; for (int i = d; i <= 600 - d; i += d) { area += i * i * d; } cout << area << endl; } return 0; }
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40]]
1
64
2
#include <iostream> using namespace std; int main(void) { int d, s; while (1) { cin >> d; if (cin.eof()) break; s = 0; for (int x = d; x < 600; x += d) s += d * x * x; cout << s; } return 0; }
#include <iostream> using namespace std; int main(void) { int d, s; while (1) { cin >> d; if (cin.eof()) break; s = 0; for (int x = d; x < 600; x += d) s += d * x * x; cout << s << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
72
2
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <stack> #include <vector> #define EPS 1e-6 using namespace std; typedef complex<double> coor; double cross(coor a, coor b) { return a.real() * b.imag() - a.imag() * b.real(); } double dot(coor a, coor b) { return...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <stack> #include <vector> #define EPS 1e-6 using namespace std; typedef complex<double> coor; double cross(coor a, coor b) { return a.real() * b.imag() - a.imag() * b.real(); } double dot(coor a, coor b) { return...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]]
1
165
2
#include <iostream> using namespace std; unsigned long long f(unsigned long long x) { return x * x; } int main() { int d; while (cin >> d) { unsigned long long s; for (int i = d; i <= 600 - d; i += d) s += d * f(i); cout << s << endl; } return 0; }
#include <iostream> using namespace std; unsigned long long f(unsigned long long x) { return x * x; } int main() { int d; while (cin >> d) { unsigned long long s = 0; for (int i = d; i <= 600 - d; i += d) s += d * f(i); cout << s << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13]]
1
80
2
#include <iostream> using namespace std; int main() { int d; cin >> d; int sum = 0; for (int i = 0; i < 600; i += d) { sum = sum + i * i * d; } cout << sum << endl; }
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int sum = 0; for (int i = 0; i < 600; i += d) { sum = sum + i * i * d; } cout << sum << endl; } }
[["+", 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
57
6
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int y = 0; for (int i = 1; i <= 600; i++) { y += d * (d * i) * (d * i); } cout << y << endl; } return 0; }
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int y = 0; for (int i = 1; i * d < 600; i++) { y += d * (d * i) * (d * i); } cout << y << endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]]
1
69
4
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int s; s = 600 / d; int a; a = 0; int b; b = 0; while (a < s) { b = b + d * d * a * a; a = a + 1; } cout << a * d << endl; } }
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int s; s = 600 / d; int a; a = 0; int b; b = 0; while (a < s) { b = b + d * d * a * a; a = a + 1; } cout << b * d << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22]]
1
80
2
#include <iostream> using namespace std; typedef long long ll; int main(void) { ll in; while (cin >> in) { ll sum = 0; for (ll i = in; i <= 600; i += in) { sum += (i * in); } cout << sum << endl; } return 0; }
#include <iostream> using namespace std; typedef long long ll; int main(void) { ll in; while (cin >> in) { ll sum = 0; for (ll i = in; i < 600; i += in) { sum += (i * i * in); } cout << sum << endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 11, 12, 23, 0, 16, 31, 16, 31, 22], ["+", 0, 11, 12, 23, 0, 16, 31, 16, 17, 48]]
1
68
4
#include <iostream> using namespace std; int main() { int d; long sum; int n; while (cin >> d) { sum = 0; n = 600 / d; for (int i = 1; i <= n; i++) { sum += d * d * d * i * i; } cout << sum << endl; } return 0; }
#include <iostream> using namespace std; int main() { int d; long sum; int n; while (cin >> d) { sum = 0; n = 600 / d; for (int i = 1; i < n; i++) { sum += d * d * d * i * i; } cout << sum << endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]]
1
76
2
#include <iostream> using namespace std; int main() { int d; cin >> d; int integral = 0; for (int i = 0; i < 600 / d; i++) { int x = i * d; int y = x * x; integral += y * d; } cout << integral << endl; return 0; }
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int integral = 0; for (int i = 0; i < 600 / d; i++) { int x = i * d; int y = x * x; integral += y * d; } cout << integral << 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
71
6
#include <iostream> using namespace std; int main(void) { int d; while (cin >> d) { int sum = 0; for (int i = 0; i < 600; i += d) { sum += d * i * i; } cout << sum; } return 0; }
#include <iostream> using namespace std; int main(void) { int d; while (cin >> d) { int sum = 0; for (int i = 0; i < 600; i += d) { sum += d * i * i; } cout << sum << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
61
2
while data = gets d = data.to_i s = 0 loop_num = 1 while loop_num * d >= 600 s += ((loop_num * d)**2) * d loop_num += 1 end puts s end
while data = gets d = data.to_i s = 0 loop_num = 1 until loop_num * d >= 600 s += ((loop_num * d)**2) * d loop_num += 1 end puts s end
[["-", 0, 493, 0, 89, 8, 170, 0, 89, 0, 89], ["+", 0, 493, 0, 89, 8, 170, 0, 750, 0, 750]]
4
41
2
while line = gets width = line.to_i sum = 0 (600 / width).times do |i| x = i * d sum += x**2 * d end puts sum end
while line = gets width = line.to_i sum = 0 (600 / width).times do |i| x = i * width sum += x**2 * width end puts sum end
[["-", 196, 737, 8, 736, 0, 662, 12, 738, 12, 22], ["+", 196, 737, 8, 736, 0, 662, 12, 738, 12, 22], ["-", 196, 737, 8, 736, 0, 755, 12, 738, 12, 22], ["+", 196, 737, 8, 736, 0, 755, 12, 738, 12, 22]]
4
39
4
#include <iostream> using namespace std; bool judge(double x1, double x2, double x3, double y1, double y2, double y3, double xp, double yp) { if (((x2 - x1) * (yp - y2)) - ((y2 - y1) * (xp - x2)) > 0) { if (((x3 - x2) * (yp - y3)) - ((y3 - y2) * (xp - x3)) > 0) { if (((x1 - x3) * (yp - y1)) - ((...
#include <iostream> using namespace std; bool judge(double x1, double x2, double x3, double y1, double y2, double y3, double xp, double yp) { if (((x2 - x1) * (yp - y2)) - ((y2 - y1) * (xp - x2)) > 0) { if (((x3 - x2) * (yp - y3)) - ((y3 - y2) * (xp - x3)) > 0) { if (((x1 - x3) * (yp - y1)) - ((...
[["+", 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], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
343
6
#include <iostream> using namespace std; class Vector { public: double x; double y; Vector(double xx = 0, double yy = 0) { x = xx; y = yy; } Vector operator+(Vector p); Vector operator-(Vector p); }; Vector Vector::operator+(Vector p) { Vector tmp; tmp.x = x + p.x; tmp.y = y + p.y; return tm...
#include <iostream> using namespace std; class Vector { public: double x; double y; Vector(double xx = 0, double yy = 0) { x = xx; y = yy; } Vector operator+(Vector p); Vector operator-(Vector p); }; Vector Vector::operator+(Vector p) { Vector tmp; tmp.x = x + p.x; tmp.y = y + p.y; return tm...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33]]
1
407
4
#include <iostream> #include <utility> using namespace std; int judge(pair<double, double> p1, pair<double, double> p2) { int S = p1.first * p2.second - p2.first * p1.second; if (0 < S) return 1; if (0 > S) return -1; if (0 == S) return 0; } int main() { pair<double, double> A, B, C, P; while...
#include <iostream> #include <utility> using namespace std; int judge(pair<double, double> p1, pair<double, double> p2) { double S = p1.first * p2.second - p2.first * p1.second; if (0 < S) return 1; if (0 > S) return -1; if (0 == S) return 0; } int main() { pair<double, double> A, B, C, P; wh...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
339
2
#include <cmath> #include <complex> #include <iostream> using namespace std; typedef complex<double> P; double cross(P a, P b) { return (a.real() * b.imag() - a.imag() * b.real()); } P vector_coord(P a, P b, P x) { return P(-cross(b, x), cross(a, x)) / cross(a, b); } int main() { double a1, b1, a2, b2, a3, b3, x...
#include <cmath> #include <complex> #include <iostream> using namespace std; typedef complex<double> P; double cross(P a, P b) { return (a.real() * b.imag() - a.imag() * b.real()); } P vector_coord(P a, P b, P x) { return P(-cross(b, x), cross(a, x)) / cross(a, b); } int main() { double a1, b1, a2, b2, a3, b3, x...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
248
2
#include <iostream> using namespace std; class Vector2 { public: Vector2() {} Vector2(double aX, double aY) : x(aX), y(aY) {} double dot(Vector2 &a) { return (x * a.x) + (y * a.y); } double x; double y; }; int main() { Vector2 p0, p1, p2, q; while (cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y ...
#include <iostream> using namespace std; class Vector2 { public: Vector2() {} Vector2(double aX, double aY) : x(aX), y(aY) {} double dot(Vector2 &a) { return (x * a.x) + (y * a.y); } double x; double y; }; int main() { Vector2 p0, p1, p2, q; while (cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y ...
[["-", 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, 23, 0, 41, 75, 5, 0, 6]]
1
341
4
#include <complex> #include <cstdio> #include <iostream> #define rep(i, n) for (int i = 0; i < (n); i++) #define EPS 1e-15 using namespace std; typedef complex<double> cd; double s(cd a, cd b) { return abs(a.real() * b.imag() - a.imag() * b.real()); } int main() { cd a[4]; double x1, y1, x2, y2, x3, y3, xp, yp; ...
#include <complex> #include <cstdio> #include <iostream> #define rep(i, n) for (int i = 0; i < (n); i++) #define EPS 1e-10 using namespace std; typedef complex<double> cd; double s(cd a, cd b) { return abs(a.real() * b.imag() - a.imag() * b.real()); } int main() { cd a[4]; double x1, y1, x2, y2, x3, y3, xp, yp; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
300
6
#include <stdio.h> int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp, p, q; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) ; { if (x1 == 0 && y1 == 0) { } else { x2 -= x1; x3 -= x1; xp -= x1; y2 -= y1; ...
#include <stdio.h> int main(void) { double x1, y1, x2, y2, x3, y3, xp, yp, p, q; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) { if (x1 == 0 && y1 == 0) { } else { x2 -= x1; x3 -= x1; xp -= x1; y2 -= y1; y3 -= y1...
[["-", 0, 14, 8, 9, 0, 52, 8, 1, 0, 35]]
1
204
1
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define EPS (1e-10) using namespace std; #define PI (3.1415926535) int main() { double x[4], y[4]; bool left, r...
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define EPS (1e-10) using namespace std; #define PI (3.1415926535) int main() { double x[4], y[4]; bool left, r...
[["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
1
248
2
#include <cmath> #include <cstdio> using namespace std; inline double out(double ax, double ay, double bx, double by) { return bx * ay - by * ax; } int main(void) { double x1, y1, x2, y2, x3, y3, px, py; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py) != EOF) { ...
#include <cmath> #include <cstdio> using namespace std; inline double out(double ax, double ay, double bx, double by) { return bx * ay - by * ax; } int main(void) { double x1, y1, x2, y2, x3, y3, px, py; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py) != EOF) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
252
2
#include <iostream> using namespace std; int main(void) { double x[4], y[4]; double xp, yp; while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) { bool l, r; l = r = false; x[3] = x[0]; y[3] = y[0]; for (int i = 0; i < 3; i++) { double ax = x[i + 1] - x[i]; d...
#include <iostream> using namespace std; int main(void) { double x[4], y[4]; double xp, yp; while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) { bool l, r; l = r = false; x[3] = x[0]; y[3] = y[0]; for (int i = 0; i < 3; i++) { double ax = x[i + 1] - x[i]; d...
[["-", 0, 43, 49, 50, 51, 16, 12, 69, 28, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 69, 28, 22], ["-", 31, 16, 12, 23, 0, 41, 15, 16, 17, 140], ["+", 31, 16, 12, 23, 0, 41, 15, 16, 17, 79]]
1
208
4
#include <math.h> #include <stdio.h> int main(void) { double x1, x2, x3, xp, y1, y2, y3, yp, l12, l23, l13, l1p, l2p, l3p, S123, S12p, S23p, S13p; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) { l12 = sqrt((x1 - x2) * (x1 - x2) + (y1 - y...
#include <math.h> #include <stdio.h> int main(void) { double x1, x2, x3, xp, y1, y2, y3, yp, l12, l23, l13, l1p, l2p, l3p, S123, S12p, S23p, S13p; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) { l12 = sqrt((x1 - x2) * (x1 - x2) + (y1 - y...
[["+", 0, 57, 15, 339, 51, 16, 31, 2, 63, 22], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 31, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
463
3
#include <iostream> double x[3], y[3], xp, yp; int main() { while (std::cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) { int bit = 2; for (int i = 0; i < 3; ++i) { double tmp = (x[(i + 1) % 3] - x[i]) * (yp - y[i]) - (y[(i + 1) % 3] - y[i]) * (xp - x[i]); bit &...
#include <iostream> double x[3], y[3], xp, yp; int main() { while (std::cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) { int bit = 3; for (int i = 0; i < 3; ++i) { double tmp = (x[(i + 1) % 3] - x[i]) * (yp - y[i]) - (y[(i + 1) % 3] - y[i]) * (xp - x[i]); bit &...
[["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13]]
1
176
2
#include <iostream> using namespace std; int gaiseki(double, double, double, double, double, double); int main() { double x[4], y[4]; int n[3], ans; while (cin >> x[0]) { cin >> y[0]; for (int i = 1; i < 4; i++) { cin >> x[i] >> y[i]; } //三角形の各辺の外積(求めたい点と始点、求めたい点と終点との外積)を取り、全て右か左だったら中に含まれる...
#include <iostream> using namespace std; int gaiseki(double, double, double, double, double, double); int main() { double x[4], y[4]; int n[3], ans; while (cin >> x[0]) { cin >> y[0]; for (int i = 1; i < 4; i++) { cin >> x[i] >> y[i]; } //三角形の各辺の外積(求めたい点と始点、求めたい点と終点との外積)を取り、全て右か左だったら中に含まれる...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
312
2
#include <algorithm> #include <cmath> #include <iostream> using namespace std; double pdot(pair<double, double> a, pair<double, double> b) { return a.first * b.first + a.second * b.second; } int main() { double a1, a2, b1, b2, c1, c2, p1, p2; cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2 >> p1 >> p2; pair<double, d...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; double pdot(pair<double, double> a, pair<double, double> b) { return a.first * b.first + a.second * b.second; } int main() { double a1, a2, b1, b2, c1, c2, p1, p2; while (cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2 >> p1 >> p2) { pai...
[["+", 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
274
6
#include <iostream> using namespace std; typedef struct { double x; double y; } vector; bool ex_product(double x0, double y0, double x1, double y1, double xp, double yp) { vector a = {x1 - x0, y1 - y0}; vector b = {xp - x0, yp - y0}; return (a.x * b.y - a.y * b.x) >= 0; } int main(int argc...
#include <iostream> using namespace std; typedef struct { double x; double y; } vector; bool ex_product(double x0, double y0, double x1, double y1, double xp, double yp) { vector a = {x1 - x0, y1 - y0}; vector b = {xp - x0, yp - y0}; return (a.x * b.y - a.y * b.x) >= 0; } int main(int argc...
[["+", 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
238
6
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef complex<double> P; const double EPS = 1e-8; const double INF = 1e6; double cross(P a, P b) { return imag(conj(a) * b); } int mai...
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef complex<double> P; const double EPS = 1e-8; const double INF = 1e6; double cross(P a, P b) { return imag(conj(a) * b); } int ma...
[["-", 51, 16, 31, 16, 31, 23, 0, 16, 17, 47], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 18], ["-", 51, 16, 31, 16, 12, 23, 0, 16, 17, 47], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 17, 18], ["-", 15, 339, 51, 16, 12, 23, 0, 16, 17, 47], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 18]]
1
273
6
def vector(x, y) [y[0] * x[0], y[1] * x[1]] end def direction(x, y) (x[0] * y[1] - x[1] * y[0]).positive? ? :+ : :- end $stdin.read.split("\n").each do |input| a, b, c, d = input.split(' ').map { |f| f.chomp.to_f }.each_slice(2).to_a result = [[a, b], [b, c], [c, a]].map do |s, e| direction(vector(s, e),...
def vector(x, y) [y[0] - x[0], y[1] - x[1]] end def direction(x, y) (x[0] * y[1] - x[1] * y[0]).positive? ? :+ : :- end $stdin.read.split("\n").each do |input| a, b, c, d = input.split(' ').map { |f| f.chomp.to_f }.each_slice(2).to_a result = [[a, b], [b, c], [c, a]].map do |s, e| direction(vector(s, e),...
[["-", 0, 735, 8, 736, 0, 516, 0, 738, 17, 48], ["+", 0, 735, 8, 736, 0, 516, 0, 738, 17, 33], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
4
178
6
readlines.each do |l| x1, y1, x2, y2, x3, y3, xp, yp = l.split.map(&:to_f) v1x = x2 - x1 v1y = y2 - y1 v2x = x3 - x1 v2y = y3 - y1 vpx = xp - x1 vpy = yp - y1 # (vpx, vpy) = t(v1x, v1y) + u(v2x, v2y) t = (vpx * v2y - vpy * v2x) / (v1x * v2y - v1y * v2x) u = (vpx * v1y - vpy * vpx) / (v1y * v2x - v2y...
readlines.each do |l| x1, y1, x2, y2, x3, y3, xp, yp = l.split.map(&:to_f) v1x = x2 - x1 v1y = y2 - y1 v2x = x3 - x1 v2y = y3 - y1 vpx = xp - x1 vpy = yp - y1 # (vpx, vpy) = t(v1x, v1y) + u(v2x, v2y) t = (vpx * v2y - vpy * v2x) / (v1x * v2y - v1y * v2x) u = (vpx * v1y - vpy * v1x) / (v1y * v2x - v2y...
[["-", 12, 738, 31, 739, 0, 738, 12, 738, 12, 22], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 12, 22]]
4
130
2
import sys def crossMulti(p1, p2): return p1[0] * p2[1] - p1[1] * p2[0] lines = sys.stdin.readlines() for line in lines: Zd = [] x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split()) Ps = [(x2-x1, y2-y1),(x3-x2, y3-y2),(x1-x3, y1-y3)] Px = [(xp-x1, yp-y1),(xp-x2, yp-y2),(xp-x3, yp-y...
import sys def crossMulti(p1, p2): return p1[0] * p2[1] - p1[1] * p2[0] lines = sys.stdin.readlines() for line in lines: Zd = [] x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split()) Ps = [(x2-x1, y2-y1),(x3-x2, y3-y2),(x1-x3, y1-y3)] Px = [(xp-x1, yp-y1),(xp-x2, yp-y2),(xp-x3, yp-y...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
226
4
out=[] while True: try: k=list(map(float,input().split(" "))) except: break O_x,O_y=k[0],k[1] A_x,A_y=k[2],k[3] B_x,B_y=k[4],k[5] P_x,P_y=k[6],k[7] # P in triangle OAB # iff s+t<1 and s>0 and t>0 (OP=sOA+tOB) OA=(A_x-O_x,A_y-O_y) OB=(B_x-O_x,B_y-O_y) OP=(P_x-O_x,P_y-O_y) keisuu=1/( OA[0]*OB[1] - OA[1...
out=[] while True: try: k=list(map(float,input().split(" "))) except: break O_x,O_y=k[0],k[1] A_x,A_y=k[2],k[3] B_x,B_y=k[4],k[5] P_x,P_y=k[6],k[7] # P in triangle OAB # iff s+t<1 and s>0 and t>0 (OP=sOA+tOB) OA=(A_x-O_x,A_y-O_y) OB=(B_x-O_x,B_y-O_y) OP=(P_x-O_x,P_y-O_y) keisuu=1/( OA[0]*OB[1] - OA[1...
[["-", 8, 196, 0, 57, 15, 679, 12, 666, 667, 47], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 0, 612], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 18], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 0, 612]]
5
237
4
def Cramer(a11, a12, a13, a21, a22, a23): den = a11 * a22 - a12 * a21 return (a13 * a22 - a12 * a23) / den, (a11 * a23 - a13 * a21) / den while True: try: x1, y1, x2, y2, x3, y3, xp, yp = [eval(item) for item in input().split()] u, v = Cramer(x3 - x1, x2 - x1, xp - x1, y3 - y1, y2 - y1, yp - y1) print('YES' i...
def Cramer(a11, a12, a13, a21, a22, a23): den = a11 * a22 - a12 * a21 return (a13 * a22 - a12 * a23) / den, (a11 * a23 - a13 * a21) / den while True: try: x1, y1, x2, y2, x3, y3, xp, yp = [eval(item) for item in input().split()] u, v = Cramer(x3 - x1, x2 - x1, xp - x1, y3 - y1, y2 - y1, yp - y1) print('YES' i...
[["-", 0, 41, 0, 679, 12, 666, 0, 657, 17, 33], ["+", 3, 4, 0, 41, 0, 679, 12, 666, 667, 19], ["-", 3, 4, 0, 41, 0, 679, 12, 666, 667, 18], ["-", 3, 4, 0, 41, 0, 679, 12, 666, 0, 531]]
5
146
4
class point: def __init__(self, x, y): self.x = x self.y = y def sub(self, p): return point(self.x - p.x, self.y - p.y) while True: try: x1, y1, x2, y2, x3, y3, xp, yp = list(map(float, input().split())) A = point(x1, y1) B = point(x2, y2) C = point(x...
class point: def __init__(self, x, y): self.x = x self.y = y def sub(self, p): return point(self.x - p.x, self.y - p.y) while True: try: x1, y1, x2, y2, x3, y3, xp, yp = list(map(float, input().split())) A = point(x1, y1) B = point(x2, y2) C = point(x...
[["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
269
4
import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = list(map(float, line.split())) AB = [x2-x1, y2-y1] BP = [xp-x2, yp-y2] BC = [x3-x2, y3-y2] CP = [xp-x3, yp-y3] CA = [x1-x3, y1-y3] BP = [xp-x1, yp-y1] c1 = AB[0] * BP[1] - AB[1] * BP[0] c2 = BC[0] * CP[1] - BC[1] * C...
import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = list(map(float, line.split())) AB = [x2-x1, y2-y1] BP = [xp-x2, yp-y2] BC = [x3-x2, y3-y2] CP = [xp-x3, yp-y3] CA = [x1-x3, y1-y3] AP = [xp-x1, yp-y1] c1 = AB[0] * BP[1] - AB[1] * BP[0] c2 = BC[0] * CP[1] - BC[1] * C...
[["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22]]
5
210
2
class vector(object): def __init__(self,a,b): self.x=b.x-a.x self.y=b.y-a.y @staticmethod def cross_product(a,b): return a.x*b.y-a.y*b.x class vertex(object): def __init__(self,a): self.x=a[0] self.y=a[1] class circle(object): def __init__(self,p,r): s...
class vector(object): def __init__(self,a,b): self.x=b.x-a.x self.y=b.y-a.y @staticmethod def cross_product(a,b): return a.x*b.y-a.y*b.x class vertex(object): def __init__(self,a): self.x=a[0] self.y=a[1] class circle(object): def __init__(self,p,r): s...
[["-", 0, 57, 64, 196, 0, 37, 0, 557, 0, 6], ["+", 0, 57, 64, 196, 0, 37, 0, 557, 0, 6], ["-", 75, 76, 8, 196, 0, 37, 0, 557, 0, 6], ["+", 75, 76, 8, 196, 0, 37, 0, 557, 0, 6]]
5
977
4
class Point(object): x = 0.0 y = 0.0 def __init__(self, x, y): self.x = x self.y = y def __sub__(left, right): return Point(left.x - right.x, left.y - right.y) #cross def __mul__(left, right): return left.x * right.y + left.y * right.x while True: try: ...
class Point(object): x = 0.0 y = 0.0 def __init__(self, x, y): self.x = x self.y = y def __sub__(left, right): return Point(left.x - right.x, left.y - right.y) #cross def __mul__(left, right): return left.x * right.y - left.y * right.x while True: try: ...
[["-", 0, 14, 8, 196, 0, 37, 0, 657, 17, 72], ["+", 0, 14, 8, 196, 0, 37, 0, 657, 17, 33]]
5
240
2
#include <stdio.h> int main() { int d, e, f; while (scanf("%d", &d) != EOF) { f = 0; for (e = 1; e * d <= 600; e++) f = f + d * d * (e - 1) * d * (e - 1); printf("%d", f); } return 0; }
#include <stdio.h> int main() { int d, e, f; while (scanf("%d", &d) != EOF) { f = 0; for (e = 1; e * d <= 600; e++) f = f + d * d * (e - 1) * d * (e - 1); printf("%d\n", f); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
84
1
#include <stdio.h> #include <stdlib.h> #include <string.h> int i, j, k, l, n, ans = 0; int main() { while (scanf("%d", &n) != EOF) { for (i = 1; i <= 600 / n; i++) { ans += (n * i) * (n * i) * n; } printf("%d\n", ans); ans = 0; } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> int i, j, k, l, n, ans = 0; int main() { while (scanf("%d", &n) != EOF) { for (i = 1; i < 600 / n; i++) { ans += (n * i) * (n * i) * n; } printf("%d\n", ans); ans = 0; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]]
0
93
2
#include <stdio.h> int main() { int a, b = 0, ans; while (scanf("%d", &a) != EOF) { b = a; ans = 0; while (b < 600) { ans += a * b * b; b += a; } printf("%d", ans); } return 0; }
#include <stdio.h> int main() { int a, b = 0, ans; while (scanf("%d", &a) != EOF) { b = a; ans = 0; while (b < 600) { ans += a * b * b; b += a; } printf("%d\n", ans); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
73
1
#include <stdio.h> int main() { int a = 0, d, c; while (~scanf("%d", &d)) { for (c = 0; c <= 600; c += d) { a += c * c * d; } printf("%d\n", a); a = 0; } return 0; }
#include <stdio.h> int main() { int a = 0, d, c; while (~scanf("%d", &d)) { for (c = 0; c < 600; c += d) { a += c * c * d; } printf("%d\n", a); a = 0; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]]
0
73
2
d, x; main(a) { for (; ~scanf("%d", &d);) { for (x = 0; x < 600; x += d) a += x * x * d; printf("%d\n", a); } }
d, x; main(a) { for (; ~scanf("%d", &d);) { a = 0; for (x = 0; x < 600; x += d) a += x * x * d; printf("%d\n", a); } }
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
0
59
4
#include <math.h> #include <stdio.h> int main() { int divisor[10000000000]; int temp, i; int area[10000000000]; for (temp = 0; scanf("%d", &divisor[temp]) != EOF; temp++) { for (i = 1; i <= (600 - divisor[temp]) / divisor[temp]; i++) { area[temp] = area[temp] + divisor[temp] * pow(i * divisor[temp], ...
#include <math.h> #include <stdio.h> int main() { int divisor[10000]; int temp, i; int area[10000]; for (temp = 0; scanf("%d", &divisor[temp]) != EOF; temp++) { for (i = 1; i <= (600 - divisor[temp]) / divisor[temp]; i++) { area[temp] = area[temp] + divisor[temp] * pow(i * divisor[temp], 2); } ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13]]
0
123
4
#include <stdio.h> int quadratic_function(int factor) { return factor * factor; } int main() { int divisor[100]; int temp, j, i; int area[100]; for (temp = 0; scanf("%d", &divisor[temp]) != EOF; temp++) ; for (j = 0; j < temp; j++) { for (i = 1; i <= (600 - divisor[j]) / divisor[j]; i++) { are...
#include <stdio.h> int quadratic_function(int factor) { return factor * factor; } int main() { int divisor[10000]; int temp, j, i; int area[10000]; for (temp = 0; scanf("%d", &divisor[temp]) != EOF; temp++) ; for (j = 0; j < temp; j++) { for (i = 1; i <= (600 - divisor[j]) / divisor[j]; i++) { ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13]]
0
148
4
#include <stdio.h> int main() { int s, i, d; while (!scanf("%d", &d)) { s = 0; for (i = 1; d * i < 600; i++) { s += d * i * d * i * d; } printf("%d\n", s); } return 0; }
#include <stdio.h> int main() { int s, i, d; while (scanf("%d", &d) != EOF) { s = 0; for (i = 1; d * i < 600; i++) { s += (d * i * d * i * d); } printf("%d\n", s); } return 0; }
[["-", 8, 9, 0, 52, 15, 23, 0, 91, 17, 111], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 79], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]]
0
76
5
#include <stdio.h> int main() { int d; int ans = 0; int ss; int i; while (scanf("%d", &d) != EOF) { for (i = 1; i <= (600 - d) / d; i++) { ss = i * d * d * d; ans += ss; } printf("%d\n", ans); } return 0; }
#include <stdio.h> int main() { int d; int ans = 0; int ss; int i; while (scanf("%d", &d) != EOF) { for (i = 1; i <= (600 - d) / d; i++) { ss = i * i * d * d * d; ans += ss; } printf("%d\n", ans); ans = 0; } return 0; }
[["+", 12, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13]]
0
86
6
#include <stdio.h> #define N 600 int main(void) { int d[100], i = 0, j = 0, k = 0; int s; while (scanf("%d", &d[i]) != EOF) { i++; } for (j = 0; j <= i; j++) { k = N / d[j] - 1; s = k * (k + 1) * (2 * k + 1) / 6 * d[j] * d[j] * d[j]; printf("%d\n", s); } return 0; }
#include <stdio.h> #define N 600 int main(void) { int d[100], i = 0, j = 0, k = 0; int s; while (scanf("%d", &d[i]) != EOF) { i++; } for (j = 0; j < i; j++) { k = N / d[j] - 1; s = k * (k + 1) * (2 * k + 1) / 6 * d[j] * d[j] * d[j]; printf("%d\n", s); } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
0
129
2
#include <math.h> #include <stdio.h> #define f(x) x *x int main(void) { int d, sum = 0; double x; while (scanf("%d", &d) != EOF) { for (x = 0; x < 600 / d; x++) { sum += f(x * d) * d; } printf("%d\n", sum); } return 0; }
#include <math.h> #include <stdio.h> #define f(x) x *x int main(void) { int d, sum = 0; double x; while (scanf("%d", &d) != EOF) { sum = 0; for (x = 0; x < 600 / d; x++) { sum += f(x * d) * d; } printf("%d\n", sum); } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
0
84
4
#include <iostream> using namespace std; int main() { int d, tmp, s = 0; while (cin >> d) { tmp = d; for (; d <= 600 - tmp; d += tmp) { s += d * d * tmp; } cout << s << endl; } return 0; }
#include <iostream> using namespace std; int main() { int d, tmp, s = 0; while (cin >> d) { tmp = d; for (; d <= 600 - tmp; d += tmp) { s += d * d * tmp; } cout << s << endl; s = 0; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
65
4
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int area = 0; for (int x; x < 600; x += d) { area += (x * x) * d; } cout << area << endl; } return 0; }
#include <iostream> using namespace std; int main() { int d; while (cin >> d) { int area = 0; for (int x = 0; x < 600; x += d) { area += (x * x) * d; } cout << area << endl; } return 0; }
[["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
62
2
#include <cmath> #include <iostream> using namespace std; int main() { int d, newd, s = 0; while (cin >> d) { newd = d; while (newd < 600) { s += d * pow(newd, 2); newd += d; } cout << s << endl; } }
#include <cmath> #include <iostream> using namespace std; int main() { int d, newd, s = 0; while (cin >> d) { s = 0; newd = d; while (newd < 600) { s += d * pow(newd, 2); newd += d; } cout << s << endl; } }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
64
4
#include <iostream> #include <string> using namespace std; int main() { int d; while (cin >> d) { int s = 0; for (int i = 0; i < 600; i += d) { s += i * i * d; } cout << d << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { int d, s; while (cin >> d) { s = 0; for (int i = 0; i < 600; i += d) { s += i * i * d; } cout << s << endl; } return 0; }
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
64
5
#include <cmath> #include <iostream> #include <stdio.h> using namespace std; int f(int x) { return x * x; } int main() { int d; while (cin >> d) { int sum = 0; int x = 0; while (x < 600) { sum += f(x); x += d; } cout << sum << endl; } }
#include <cmath> #include <iostream> #include <stdio.h> using namespace std; int f(int x) { return x * x; } int main() { int d; while (cin >> d) { int sum = 0; int x = 0; while (x < 600) { sum += f(x) * d; x += d; } cout << sum << endl; } }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
75
2
#include <iostream> int main() { int d, area; while (std::cin >> d) { area = 0; for (int i = 1; i < 600 / d; ++i) area += i * i * d * d; std::cout << area << std::endl; } return 0; }
#include <iostream> int main() { int d, area; while (std::cin >> d) { area = 0; for (int i = 1; i < 600 / d; ++i) area += i * i * d * d * d; std::cout << area << std::endl; } return 0; }
[["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 22]]
1
66
2
#include <iostream> using namespace std; long long int f(int a) { return (long long int)a * a; } int main() { int d, od, num; long long int s = 0; while (cin >> d) { num = 600 / d; od = d; for (int i = 0; i < num; i++) { s += od * f(d); d += od; } cout << s << endl; s = 0; ...
#include <iostream> using namespace std; long long int f(int a) { return (long long int)a * a; } int main() { int d, od, num; long long int s = 0; while (cin >> d) { num = 600 / d; od = d; d = 0; for (int i = 0; i < num; i++) { s += od * f(d); d += od; } cout << s << endl; ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
106
4
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { int d, ans; while (cin >> d) { for (int i = 0; i < 600; i += d) { ans += d * i * i; } cout << ans << endl; } return 0; }
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { int d, ans; while (cin >> d) { ans = 0; for (int i = 0; i < 600; i += d) { ans += d * i * i; } cout << ans << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
63
4
#include <iostream> using namespace std; int main() { int d, x, y, s = 0; while (cin >> d) { x = 600; for (x -= d; x > 0; x -= d) { y = x * x; s += y * d; } cout << s << endl; } return 0; }
#include <iostream> using namespace std; int main() { int d, x, y, s = 0; while (cin >> d) { x = 600; s = 0; for (x -= d; x > 0; x -= d) { y = x * x; s += y * d; } cout << s << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
72
4
#include <bits/stdc++.h> using namespace std; int main() { int d; cin >> d; int result = 0; for (int i = 1; d * i <= 600 - d; i++) { result += (i * d) * (i * d) * d; } cout << result << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int d; while (cin >> d) { int result = 0; for (int i = 1; d * i <= 600 - d; i++) { result += (i * d) * (i * d) * d; } cout << result << 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
69
6