alexjercan/bugnet huggingface dataset:
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <stdio.h>
#define EE 0.0000001

using namespace std;

int main(void) {
  double a, b, c, d, e, f, delta, kai, kait;
  while (1) {
    if (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &e, &c, &d, &f) == EOF)
      break;
    delta = a * d - b * c;
    kai = (d * e - b * f) / (delta);
    kait = (a * f - e * c) / (delta);
    if ((kai >= 0 - EE) && (kai <= 0 + EE))
      kai = 0.0;
    printf("%.3f %.3f\\n", kai, kait);
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
  double a, b, c, d, e, f, delta, kai, kait;
  while (1) {
    cin >> a >> b >> e >> c >> d >> f;
    delta = a * d - b * c;
    kai = (d * e - b * f) / delta;
    kait = (a * f - e * c) / delta;
    printf("%.3f %.3f\\n", kai, kait);
  }

  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>

using namespace std;

int main() {
  double a, b, c, d, e, f;
  double x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    y = (double)(a * f - d * c) / (a * e - b * d);
    x = (c - b * y) / a;
    cout << setprecision(3) << setiosflags(ios::fixed) << x << ' '
         << setprecision(3) << setiosflags(ios::fixed) << y << endl;
  }
  return 0;
}

Error: -11

Fixed submission:

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {
  char string[54];
  double a, b, c, d, e, f, x, y;
  scanf("%s", string);

  a = atof(strtok(string, " "));
  b = atof(strtok(NULL, " "));
  c = atof(strtok(NULL, " "));
  d = atof(strtok(NULL, " "));
  e = atof(strtok(NULL, " "));
  f = atof(strtok(NULL, " "));

  x = (f * b - e * c) / (d * b - e * a);
  y = (f * a - d * c) / (e * a - d * b);

  printf("%.3f %.3f\\n", x, y);

  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#define abs(x) (x > 0 ? x : -x)

int main() {
  int a, b, c, d, e, f;
  double g, x, y;

  while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
    g = a * e - b * d;
    x = e * c + (-b) * f;
    y = (-d) * c + a * f;
    x = (x == 0 ? 0.000 : x / g);
    y = (y == 0 ? 0.000 : y / g);
    printf("%.3lf %.3lf\\n", x, y);
  }
  return 0;
}

Error: WA

Fixed submission:

#include <cstdio>

int main() {
  int a, b, c, d, e, f;
  double g;

  while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
    g = a * e - b * d;
    printf("%lf %lf\\n", (e * c + (-b) * f) / d, ((-d) * c + a * f) / d);
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>

using namespace std;
int main() {
  double a, b, c, d, e, f;
  while ((cin >> a >> b >> c >> d >> e >> f)) {
    double x = (c * e - b * f) / (a * e - b * d);
    double y = (c * d - a * f) / (b * d - a * e);
    x = round(1000 * x) / 1000;
    y = round(1000 * y) / 1000;
    if (x == 0)
      x = 0;
    if (y == 0)
      y = 0;
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

//
//  main.cpp
//  Sample
//
//  Created by h3037183 on 2017/07/31.
//  Copyright ?? 2017??´ ?°????. All rights reserved.
//

#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  double a, b, c, d, e, f, x, y;
  for (;;) {
    cin >> a >> b >> c >> d >> e >> f;
    x = (c * e - b * f) / (a * e - b * d);
    y = (c * d - f * a) / (b * d - a * e);
    if (x == 0)
      x = 0;
    if (y == 0)
      y = 0;
    printf("%.3lf %.3lf", x, y);
    cout << endl;
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
  float a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (e * c - b * f) / (a * e - b * d);
    y = (-d * c + a * f) / (a * e - b * d);
    if (x == 0)
      x = 0;
    if (y == 0)
      y = 0;
    cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3)
         << y << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>
int main(void) {
  float a, b, c, d, e, f, x, y;
  while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)) {
    x = ((c * e) - (b * f)) / ((a * e) - (b * d));
    y = ((a * f) - (c * d)) / ((a * e) - (b * d));
    if (x == 0) {
      x = x * (-1);
    }
    if (y == 0) {
      y = y * (-1);
    }
    printf("%.3f %.3f\\n", x, y);
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main(void) {
  double x = 0, y = 0;
  double a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, i = 0, j;

  while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) {
    y = (c * d - a * f) / (b * d - e * a);

    x = (c - (b * y)) / a;

    printf("%.3lf %.3lf\\n", x, y);
  }
  return 0;
}

Error: -8

Fixed submission:

#include <math.h>
#include <stdio.h>

int main(void) {
  double x1[1000], y1[1000];
  int a[1000], b[1000], c[1000], d[1000], e[1000], f[1000], i = 0, j, r = 0,
                                                            x2[1000], y2[1000];

  while (r == 0) {
    scanf("%d %d %d %d %d %d", &a[i], &b[i], &c[i], &d[i], &e[i], &f[i]);
    x2[i] =
        (c[i] * e[i] - b[i] * d[i]) / (a[i] * e[i] - b[i] * d[i]) * 1000 + 0.5;
    y2[i] =
        (d[i] * c[i] - a[i] * f[i]) / (b[i] * d[i] - a[i] * e[i]) * 1000 + 0.5;

    if (a[i] < -1000 || a[i] > 1000 || b[i] < -1000 || b[i] > 1000 ||
        c[i] < -1000 || c[i] > 1000 || d[i] < -1000 || d[i] > 1000 ||
        e[i] < -1000 || e[i] > 1000 || f[i] < -1000 || f[i] > 1000)
      break;

    i = i + 1;
  }
  for (j = 0; j < i; j++) {
    x1[j] = x2[j] / 1000;
    y1[j] = y2[j] / 1000;
    printf("%f %f\\n", x1[j], y1[j]);
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main() {
  double a, b, c, d, e, f;
  double x, y, z, v;
  while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != -1) {
    x = (c * e - b * f) / (a * e - b * d);
    y = (c * d - a * f) / (b * d - a * e);
    if (x >= -0.0005 && x < 0.0005)
      x = 0;
    if (y >= -0.0005 && y < 0.0005)
      y = 0;
    printf("%.3lf %.3lf\\n", x, y);
  }
}

Error: TLE

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, c, d, e, f;
  double x, y, z, v;
  while (1) {
    scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
    x = (double)(c * e - b * f) / (a * e - b * d);
    y = (double)(c * d - a * f) / (b * d - a * e);
    if (x >= -0.0005 && x < 0.0005)
      x = 0;
    if (y >= -0.0005 && y < 0.0005)
      y = 0;
    printf("%.3lf %.3lf\\n", x, y);
  }
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>
using namespace std;

int main() {
  double a, b, c, d, e, f;
  double y, x;
  while (cin >> a >> b >> c >> d >> e >> f) {
    y = (c * d - a * f) / (d * b - a * e);
    x = (c - b * y) / a;

    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}


Error: 0

Fixed submission:

#include <iomanip>
#include <iostream>
using namespace std;

int main() {
  int a, b, c, d, e, f;
  double y, x;
  while (cin >> a >> b >> c >> d >> e >> f) {
    y = (c - a * f / d) / (b - a * e / d);
    x = (c - b * y) / a;
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>
#include <iostream>
using namespace std;

int main() {

  double a, b, c, d, e, f, x = 0, y = 0; // ???????°???°?????°??? %f
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (double)((b * f - c * e) / (b * d - a * e));
    y = (double)((a * f - c * d) / (a * e - b * d));
    if (x == 0)
      x = 0.000;
    if (y == 0)
      y = 0.000;

    printf("%.3f %.3f\\n", x, y);
  }
}

Error: TLE

Fixed submission:

#include <cstdio>
#include <iostream>
using namespace std;

int main() {
  while (1) {
    double a, b, c, d, e, f, x = 0, y = 0; // ???????°???°?????°??? %f
    cin >> a >> b >> c >> d >> e >> f;

    x = (b * f - c * e) / (b * d - a * e);
    y = (a * f - c * d) / (a * e - b * d);

    printf("%.3f %.3f\\n", x, y);
  }
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iomanip>
#include <iostream>
using namespace std;

int main() {
  double a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    double y = (a * f - c * d) / (a * e - b * d);
    double x = (c - b * y) / a;
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iomanip>
#include <iostream>

using namespace std;

int main() {
  float a, b, c, d, e, f, x, y, z, q, p;

  while (1) {
    cin >> a >> b >> c >> d >> e >> f;
    z = a / d;
    d *= z, e *= z, f *= z;
    q = b - e;
    p = c - f;
    y = p / q;
    x = a / (c - (b * y));
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <stdio.h>

using namespace std;

double a, b, c, d, e, f;
double x, y;

int main() {
  while (cin >> a >> b >> c >> d >> e >> f) {
    double det = a * e - b * d;
    x = (c * e - b * f) / det;
    y = (a * f - c * d) / det;
    if (x == -0)
      x = 0;
    if (y == -0)
      y = 0;
    printf("%.3f %.3f\\n", x, y);
  }
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <stdio.h>

using namespace std;

double a, b, c, d, e, f;
double x, y;

int main() {
  while (1) {
    cin >> a >> b >> c >> d >> e >> f;
    y = (c - f * a / d) / (b - e * a / d);
    x = -b / a * y + c / a;
    printf("%.3lf %.3lf\\n", x, y);
  }
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>

using namespace std;

int main() {
  double x, y, a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (c * e - f * b) / (a * e - d * b);
    y = (a * f - d * c) / (a * e - d * b);
    if (abs(x) <= (0.0 + numeric_limits<double>::epsilon()))
      x = +0.00000000;
    if (abs(y) <= (0.0 + numeric_limits<double>::epsilon()))
      y = +0.00000000;
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <cstdio>
#include <iostream>

using namespace std;

int main() {
  double x, y, a, b, c, d, e, f;
  while (1) {
    cin >> a >> b >> c >> d >> e >> f;
    if (a == 0)
      break;
    x = (c * e - f * b) / (a * e - d * b);
    y = (a * f - d * c) / (a * e - d * b);
    printf("%.3lf %.3lf\\n", x, y);
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>
#include <math.h>
#include <sstream>
#include <stdlib.h>
#include <string.h>

using namespace std;

string float_to_string(float f, int digits) {
  if (f == 0) {
    f = 0;
  }
  ostringstream oss;
  oss << setprecision(digits) << setiosflags(ios::fixed) << f;
  return oss.str();
}

void calc_and_output(int *c) {
  float x = (float)(c[1] * c[5] - c[2] * c[4]) / (c[1] * c[3] - c[0] * c[4]);
  float y = (float)(c[0] * c[5] - c[2] * c[3]) / (c[0] * c[4] - c[1] * c[3]);

  cout << float_to_string(x, 3) << " " << float_to_string(y, 3) << endl;
}

int main(int argc, char const *argv[]) {
  int c[6];

  string line;
  while (getline(cin, line)) {
    istringstream iss(line);
    int val;
    int c[6];
    for (int i = 0; i < 6; i++) {
      iss >> val;
      c[i] = val;
    };

    calc_and_output(c);
  }

  return 0;
}

Error: -11

Fixed submission:

#include <iomanip>
#include <iostream>
#include <math.h>
#include <sstream>
#include <stdlib.h>
#include <string.h>

using namespace std;

string float_to_string(float f, int digits) {
  ostringstream oss;
  oss << setprecision(digits) << setiosflags(ios::fixed) << f;
  return oss.str();
}

int main(int argc, char const *argv[]) {
  int c[6];
  for (int i = 0; i < 6; i++) {
    c[i] = atoi(argv[i + 1]);
  }

  float x = (float)(c[1] * c[5] - c[2] * c[4]) / (c[1] * c[3] - c[0] * c[4]);
  float y = (float)(c[0] * c[5] - c[2] * c[3]) / (c[0] * c[4] - c[1] * c[3]);

  cout << float_to_string(x, 3) << " " << float_to_string(y, 3) << endl;
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  float a, b, c, d, e, f, x, y;
  while (cin >> a) {
    cin >> b >> c >> d >> e >> f;
    x = (c * e - b * f) / (a * e - b * d);
    y = (c * d - a * f) / (b * d - a * e);
    if (x > -0.0005 && x <= 0.0005) {
      x = 0;
    }
    if (y > -0.0005 && y <= 0.0005) {
      y = 0;
    }
    printf("%.3f %.3f", x, y);
    cout << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>

int main() {
  float a, b, c, d, e, f, x, y;
  while (scanf("%f", &a)) {
    scanf("%f%f%f%f%f", &b, &c, &d, &e, &f);
    x = (c * e - b * f) / (a * e - b * d);
    y = (c * d - a * f) / (b * d - a * e);
    if (x > -0.0005 && x <= 0.0005) {
      x = 0;
    }
    if (y > -0.0005 && y <= 0.0005) {
      y = 0;
    }
    printf("%.3f %.3f", x, y);
    std::cout << std::endl;
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>

double a, b, c, d, e, f;
double x, y;

int main() {
  while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) {
    if (b != 0)
      y = (d * c - a * f) / (d * b - a * e);
    else
      y = (a * f - d * c) / (a * e - d * b);
    if (a != 0)
      x = (c - b * y) / a;
    else
      x = (f - e * y) / d;
    printf("%.3lf %.3lf\\n", x, y);
  }
  return 0;
}

Error: WA

Fixed submission:

#include <cstdio>

int a, b, c, d, e, f;
double x, y;

int main() {
  while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
    y = (d * c - a * f) / (d * b) - a * e;
    x = (c - b * y) / a;
    printf("%.3lf %.3lf", x, y);
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#include <iostream>
using namespace std;

int main() {
  float a, b, c, d, e, f;
  while (-1 != scanf("%f%f%f%f%f%f", &a, &b, &c, &d, &e, &f)) {
    b /= a;
    c /= a;
    e -= d * b;
    f -= d * c;
    f /= e;
    c -= b * f;

    printf("%.3f %.3f\\n", c, f);
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
#include <stdio.h>

using namespace std;

int main() {

  int a, b, c, d, e, f;

  while (cin >> a >> b >> c >> d >> e >> f) {
    double x, y;

    y = (c / a - f / d) / (b / a - e / d);
    x = c / a - b / a * y;

    double diff = 0.5;

    x < 0 ? (diff = -0.5) : (diff = 0.5);
    x = (int)(x * 1000 + diff);

    y < 0 ? (diff = -0.5) : (diff = 0.5);
    y = (int)(y * 1000 + diff);

    x /= 1000;
    y /= 1000;

    printf("%.3f %.3f\\n", x, y);
  }

  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main(void) {
  float a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    float delta = -a * e + b * d;
    float y = (-a * f + c * d) / delta;
    float x = (c - b * y) / a;
    printf("%.3f %.3f\\n", x, y);
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main(void) {
  while (scanf("") != EOF) {
    float equ[2][3];
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 3; j++)
        cin >> equ[i][j];
    float delta = -equ[0][0] * equ[1][1] + equ[0][1]

                                               * equ[1][0];
    float y = (-equ[0][0] * equ[1][2] + equ[0][2] * equ

                                                        [1][0]) /
              delta;
    float x = (equ[0][2] - equ[0][1] * y) / equ[0][0];
    printf("%.3f %.3f\\n", x, y);
  }
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>
#include <iostream>
using namespace std;

int main() {
  double a, b, c, d, e, f;
  double x, y;

  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (e * c - b * f) / (a * e - d * b);
    y = (d * c - a * f) / (b * d - e * a);
    if (x == 0)
      x = 0;
    if (y == 0)
      y = 0;
    printf("%.3f %.3f\\n", x, y);
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <cstdio>
#include <iostream>

using namespace std;

int main() {
  double a = 1, b, c, d, e, f;

  while (a) {
    cin >> a >> b >> c >> d >> e >> f;
    double x, y;
    x = (c * e - b * f) / (a * e - b * d);
    y = (c * d - a * f) / (b * d - a * e);
    printf("%.3f %.3f\\n", x, y);
  }

  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#define pf printf
#define sf scanf
#define wh while
#define db double
#define LL long long
#define _USE_MATH_DEFINES
#define re(i, a, b) for (int i = a; i < b; i++)
#define rev(i, a, b) for (int i = a; i >= b; i--)

using namespace std;

int main() {
  db a, b, c, d, e, f, x, y;
  wh(sf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) == 6) {
    if ((e * c - b * f) == 0)
      x = 0;
    else
      x = (e * c - b * f) / (a * e - b * d);
    y = (c - a * x) / b;
    pf("%.3lf %.3lf\\n", x, y);
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  float x, y;
  while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f)) {

    int i = a * e - b * d;
    int j = c * e - b * f;
    int k = a * f - c * d;
    x = j / i;
    y = k / i;
    printf("%.3f %.3f", x, y);
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;

/*
//my header
#include "define.h"
#include "geometry.h"*/

#define MyAbs(a) ((a) > 0 ? (a) : -(a))
#define MyEqualDoule(a, b) (MyAbs(a - b) < 1e-6)

void init() {
#ifdef _WIN32
  freopen("1.txt", "r", stdin);
#endif
}

void func();

int main() {
  init();
  func();

  return 0;
}

void func() {
  int a, b, c, d, e, f;
  float x, y;
  while (~scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f)) {
    x = (c * e - f * b) * 1.0 / (a * e - b * d);
    y = (c * d - a * f) * 1.0 / (b * d - a * e);
    float x2 = (c - b * y) * 1.0 / a;
    if (x - x2 != 0)
      while (1)
        ;
    if (MyEqualDoule(x, 0))
      x = 0;
    printf("%.3f %.3f\\n", x, y);
  }
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;

/*
//my header
#include "define.h"
#include "geometry.h"*/

#define MyAbs(a) ((a) > 0 ? (a) : -(a))
#define MyEqualDoule(a, b) (MyAbs(a - b) < 1e-6)

void init() {
#ifdef _WIN32
  freopen("1.txt", "r", stdin);
#endif
}

void func();

int main() {
  init();
  func();

  return 0;
}

void func() {
  int a, b, c, d, e, f;
  float x, y;
  while (~scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f)) {
    x = (c * e - f * b) * 1.0 / (a * e - b * d);
    y = (c * d - a * f) * 1.0 / (b * d - a * e);
    float x2 = (c - b * y) * 1.0 / a;
    if (x - x2 == 0)
      while (1)
        ;
    printf("%.3f %.3f\\n", x2, y);
  }
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#include <iostream>

using namespace std;

int main() {
  double a, b, c, d, e, f;
  double x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    double g = b * d - a * e;
    printf("%.3lf %.3lf\\n",
           ((long long)((1000 * (b * f - c * e) / g))) / 1000.0,
           ((long long)((1000 * (d * c - a * f) / g))) / 1000.0);
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  double x, y;
  while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()) {
    y = b / e;
    x = (y * f - c) / (y * d - a);
    y = (c - a * x) / b;
    cout.setf(ios::fixed);
    cout.precision(3);
    ;
    cout << x << " " << y << endl;
  }
  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

/*************************************************************************
        > File Name: 23.cpp
        > Author: ralph
        > Mail: 1694487365@qq.com
        > Created Time: 2018年12月21日 星期五 21时32分48秒
 ************************************************************************/

#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b, c, d, e, f;
  while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
    double ans1 = (c * e - b * f) / (a * e - b * d),
           ans2 = (a * f - c * d) / (a * e - b * d);
    printf("%.3f %.3f\\n", ans1 == 0 ? 0 : ans1, ans2 == 0 ? 0 : ans2);
  }
}


Error: TLE

Fixed submission:

/*************************************************************************
        > File Name: 23.cpp
        > Author: ralph
        > Mail: 1694487365@qq.com
        > Created Time: 2018年12月21日 星期五 21时32分48秒
 ************************************************************************/

#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b, c, d, e, f;
  while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f)) {
    printf("%.3f %.3f\\n",
           (c * e - b * f) / (a * e - b * d) == 0
               ? 0.000
               : (c * e - b * f) / (a * e - b * d),
           (a * f - c * d) / (a * e - b * d) == 0
               ? 0.000
               : (a * f - c * d) / (a * e - b * d));
  }
}
Problem p00004 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <stdio.h>

using namespace std;

int main(int argc, char const *argv[]) {
  double a, b, c, d, e, f, x, y;

  while (cin >> a >> b >> c >> d >> e >> f) {
    double det = 1 / (a * e - b * d);

    x = (c * e - b * f) * det;
    y = (a * f - c * d) * det;

    x *= 1000;
    y *= 1000;
    x = int(x + .5 - (x < 0));
    y = int(y + .5 - (y < 0));
    y /= 1000;
    x /= 1000;
    printf("%.3f %.3f\\n", x, y);
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int main(int argc, char const *argv[]) {
  double a, b, c, d, e, f, x, y;

  while (1) {
    cin >> a >> b >> c >> d >> e >> f;
    double hoge = a * e - b * d;

    x = (e * c - b * f) / hoge;
    y = (-c * d + a * f) / hoge;

    x *= 1000;
    if (x >= .5)
      x = int(x + .5 - (x < 0));
    else
      x = int(x);
    x /= 1000;

    y *= 1000;
    if (y >= .5)
      y = int(y + .5 - (y < 0));
    else
      y = int(y);
    y /= 1000;

    printf("%1.3f %1.3f\\n", x, y);
  }

  return 0;
}
Problem p00004 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>
using namespace std;

int main(void) {
  double a, b, c, d, e, f;
  double ansX, ansY;
  while (std::cin >> a >> b >> c >> d >> e >> f) {
    ansX = (c * e - b * f) / (a * e - b * d);
    ansX *= 1000;
    if (ansX > 0)
      ansX += 0.5;
    else
      ansX -= 0.5;
    ansX = int(ansX);
    ansX /= 1000;

    ansY = (a * f - c * d) / (a * e - b * d);
    ansY *= 1000;
    if (ansY > 0)
      ansY += 0.5;
    else
      ansY -= 0.5;
    ansY = int(ansY);
    ansY /= 1000;

    std::cout << fixed << setprecision(3) << ansX << " " << fixed
              << setprecision(3) << ansY << std::endl;
  }

  return 0;
}

Error: WA

Fixed submission:

#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
  int a, b, c, d, e, f, g, x, y;
  double ansX, ansY;
  while (std::cin >> a >> b >> c >> d >> e >> f) {
    y = -d * b + e;
    g = d * c * -1 + f;

    ansY = g / y;

    x = b * ansY * -1;

    ansX = c + x;

    std::cout << fixed << setprecision(3) << ansX << " " << ansY << std::endl;
  }
  return 0;
}