alexjercan/bugnet huggingface dataset:
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {
  int n = 0;
  scanf("%d", &n);
  int ans = n * n * n;
  printf("%d\\n", ans);
  return 0;
}


Error: 17
usage: exe param


Fixed submission:

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

int main(int argc, char *argv[]) {
  if (argc != 2) {
    return fprintf(stderr, "usage: exe param\\n");
    return -1;
  }
  int n = atoi(argv[1]);
  int ans = n * n * n;
  printf("%d\\n", ans);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int x, sum;

  cin >> x;

  sum = x * x * x;
  cout << sum << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int x, sum;
  do {
    cin >> x;
  } while (x < 1 || x > 10);
  sum = x * x * x;
  cout << sum << endl;

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

#include <stdio.h>

int main(void) {
  int x, xxx;
  scanf("%d", &x);
  xxx = x * x * x;
  printf("%d\\n", xxx);

  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main(void) {
  int x;
  scanf("%d", x);
  printf("%d \\n", x * x * x);

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

#include <stdio.h>

int main(void) {
  int x;
  scanf("%d", &x);
  x = x * x * x;
  printf("%d\\n", x);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main(void) {
  int x;
  scanf("%d", x);
  printf("%d", x * 2);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;
  cout << x * x * x << endl;
  return 0;
}

Error: 8

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;
  return x * x * x;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main(void) {
  int x, y;
  scanf("%d", &x);
  y = x * x * x;
  printf("%d\\n", y);
  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {
  int x, y;
  scanf("%d", x);
  y = x * x * x;
  printf("%d\\n", y);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x, y;
  cin >> x;
  y = x * x * x;
  cout << y << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int i, x, y;
  cin >> x;
  for (i = 1; i <= 3; i *= x)
    y = i;
  cout << y << endl;
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a, b;
  scanf("%d", &a);
  b = a * a * a;
  printf("%d\\n", b);
}


Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int a;
  scanf("%d", a);
  printf("%d", a * a * a);
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <cmath>
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  int n = 0, n2 = 0;
  cin >> n;
  // n = atoi(argv[1]);
  if (n < 1 || n > 100) {
    return 1;
  }
  n2 = pow(n, 3.0);
  cout << n2 << endl;
}


Error: -11

Fixed submission:

#include <cmath>
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  int n = 0, n2 = 0;
  // cin >> n;
  n = atoi(argv[1]);
  if (n < 1 || n > 100) {
    return 1;
  }
  n2 = pow(n, 3.0);
  cout << n2 << endl;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
int main() {
  int a, b;
  scanf("%d", &a);
  b = a * a * a;
  printf("%d\\n", b);
  return 0;
}

Error: -11

Fixed submission:

#include <cstdio>
int main() {
  int a, b;
  scanf("%d", a);
  b = a * a * a;
  printf("%d\\n", b);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main(void) {
  // Your code here!
  int x;
  scanf("%d", &x);
  printf("%d\\n", x * x * x);

  return 0;
}


Error: TLE

Fixed submission:

#include <stdio.h>
char field[7][7] = {0};
int mem[7][7] = {0};
char x, y;
int cou = 0;
int o = 0;
int dx[4] = {0, -1, 0, 1}, dy[4] = {1, 0, -1, 0};
char jud[2] = {'o', 'x'};
int win[2] = {0};
int f = 0;

int in(char x, char y) {
  field[(x - 65) / 4 + (y - 65) / 4]
       [((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2] = '+';
  cou++;
  for (int i = 0; i < 4; i++) {
    if (((x - 65) / 4 + (y - 65) / 4) - dx[i] != -1 &&
        (((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2) - dy[i] != -1 &&
        ((x - 65) / 4 + (y - 65) / 4) - dx[i] != 7 &&
        (((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2) - dy[i] != 7) {
      mem[((x - 65) / 4 + (y - 65) / 4) - dx[i]]
         [(((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2) - dy[i]]++;
    }
  }
  return 0;
}

int che() {
  f = 0;
  for (int i = 1; i < 7; i = i + 2) {
    for (int j = 1; j < 7; j = j + 2) {
      if (mem[i][j] == 4) {
        f++;
        mem[i][j] = 0;
        field[i][j] = jud[o % 2];
        win[o % 2]++;
      }
    }
  }
  if (f == 0) {
    o++;
  }
  return 0;
}

int kar(char x, char y) {
  in(x, y);
  che();
  return 0;
}

int pri() {
  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < 7; j++) {
      printf("%c", field[i][j]);
    }
    printf("\\n");
  }
  printf("\\n");
  return 0;
}

int main() {
  int a = 0;
  printf("??£???????????????\\n\\n");
  printf("?????????????????????????????¢???????????????????????§????????§??\\???"
         "??????????????????\\n\\n");
  for (int i = 0; i < 8; i = i + 2) {
    for (int j = 0; j < 8; j = j + 2) {
      field[i][j] = a + 65;
      a++;
    }
  }
  while (cou < 24) {
    if (f != 0) {
      printf("?????? ");
    }
    if (o % 2 == 0) {
      printf("o?????????????????§???\\n\\n");
    } else {
      printf("x?????????????????§???\\n\\n");
    }
    pri();
    scanf(" %c %c", &x, &y);
    printf("\\n");
    if ('A' <= x && x <= 'Z' && 'A' <= y && y <= 'Z') {
      if (field[(x - 65) / 4 + (y - 65) / 4]
               [((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2] == '\\0') {
        if (x >= y && x - y == 1 || x - y == 4) {
          kar(x, y);
        } else if (y > x && y - x == 1 || y - x == 4) {
          kar(x, y);
        } else {
          printf("??£??\\????????¢???????????????????????\\?????????????????????"
                 "\\n\\n");
        }
      } else {
        printf("?????????????????????????????????\\n\\n");
      }
    } else {
      if ('a' <= x && x <= 'z' && 'a' <= y && y <= 'z') {
        printf("??§????????§??\\?????????????????????\\n\\n");
      } else {
        printf(
            "??§???????????¢????????????????????§??\\?????????????????????\\n\\n");
      }
    }
  }
  pri();
  if (win[0] > win[1]) {
    printf("o win\\n\\n");
  } else {
    printf("x win\\n\\n");
  }
  printf("o %d\\nx %d\\n", win[0], win[1]);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {

  int x;
  scanf("%d", &x);
  printf("%d\\n", x * x * x);
}


Error: 2

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x;

  cin >> x;

  cout << x * x * x << endl;

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

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

double charToDouble(char *c) { return atof(c); }

std::string doubleToString(double x) {
  char c[256] = {'\\0'};
  sprintf(c, "%.0f", x);

  return c;
}

int main() {
  int x;
  std::cin >> x;
  double y = pow(double(x), 3);
  std::cout << doubleToString(y) << std::endl;
}

Error: -11

Fixed submission:

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

double charToDouble(char *c) { return atof(c); }

std::string doubleToString(double x) {
  char c[256] = {'\\0'};
  sprintf(c, "%.0f", x);

  return c;
}

int main(int argc, char *argv[]) {
  double y = pow(charToDouble(argv[1]), 3);
  std::cout << doubleToString(y) << std::endl;
}
Problem p02388 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int i;
  cin >> i;
  cout << i * i * i << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int i;
  for (;;) {
    cin >> i;
    cout << i * i * i << endl;
  }
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;
  cout << x * x * x << endl;
}

Error: -11

Fixed submission:

#include <iostream>
#include <string>
int main(int argc, char const *argv[]) {
  std::string str;
  int i, answer;
  str += argv[1];
  i = std::stoi(str);
  answer = i * i * i;
  std::cout << answer << std::endl;
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a;
  scanf("%d", &a);
  printf("%d\\n", a * a * a);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int a;
  scanf("%d", a);
  printf("%d\\n", a * a * a);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {

  int x;

  scanf("%d", &x);

  x = x * x * x;

  printf("%d\\n", x);
}

Error: -11

Fixed submission:

#include <stdio.h>

int main() {

  int x;

  scanf("%d", x);

  x = x * x * x;

  printf("%d\\n", x);
}
Problem p02388 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>

int main() {

  int x;
  scanf("%d", &x);
  printf("%d\\n", x * x * x);
}


Error: TLE

Fixed submission:

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

int main(void) {
  for (int i = 0; 1 <= i <= 100; i++) {
    // 3乗
    printf("%dの3乗は%1f\\n", i + 1, pow(i + 1, 3.0));
  }

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

#include <iostream>
using namespace std;

int main() {
  int x;

  cin >> x;

  cout << x * x * x << endl;

  return 0;
}


Error: TLE

Fixed submission:

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

int main(int argc, const char *argv[]) {
  int x = 0;
  while (0 > x || x < 100) {
    cin >> x;
  }
  cout << pow(x, 3.0);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main(void) {
  int input = 0;

  cin >> input;
  cout << input * input * input << "\\n";
  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>

int main() {
  int x;
  int outdata;
  scanf("%d", x);
  if (x >= 1 && x <= 100) {
    outdata = x * x * x;
    printf("%d\\n", outdata);
  }

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

#include <stdio.h>

int main(void) {
  int x;
  scanf("%d", &x);
  printf("%d\\n", x * x * x);
}

Error: 8

Fixed submission:

#include <stdio.h>

int main(void) {
  int x;
  scanf("%d", &x);
  return x * x * x;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main(int argc, char *argv[]) {
  int x;
  scanf("%d", &x);
  printf("%d\\n", x * x * x);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main(int argc, char *argv[]) {
  int x = scanf("%d", argv[1]);
  printf("%d\\n", x * x * x);
  return 0;
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int x;
  scanf("%d", &x);
  printf("%d\\n", x * x * x);
}

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int x;
  scanf("%d", x);
  printf("%d\\n", x * x * x);
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main(void) {
  int a;
  scanf("%d", &a);
  int b = a * a * a;
  printf("%d\\n", b);
  return (0);
}

Error: 8

Fixed submission:

#include <stdio.h>

int main(void) {
  int a;
  scanf("%d", &a);
  int b = a * a * a;
  return (b);
}
Problem p02388 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>

int main() {
  int x;
  std::cin >> x;
  std::cout << x * x * x << std::endl;
}

Error: 2

Fixed submission:

#include <iostream>

int main() {
  int x;
  std::cin >> x;
  std::cout << x * x * x << std::endl;
  return x;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a, b, c, d;
  scanf("%d %d", &a, &b);
  c = a * b;
  d = a * 2;
  d += b * 2;
  printf("%d %d\\n", c, d);
  return (0);
}

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, c, d;
  scanf("%d %d", a, b);
  c = a * b;
  d = a * 2;
  d += b * 2;
  printf("%d %d", c, d);
  return (0);
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main(void) {
  int x, y;
  scanf("%d %d", &x, &y);
  printf("%d %d\\n", x * y, 2 * (x + y));
  return 0;
}


Error: -11

Fixed submission:

#include <cstdio>
#include <cstdlib>
int main(int argc, char *argv[]) {
  int x = atoi(argv[1]);
  int y = atoi(argv[2]);
  printf("%d %d\\n", x * y, 2 * (x + y));
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a, b, x, y;
  scanf("%d %d", &a, &b);
  x = a * b;
  y = 2 * (a + b);
  printf("%d %d\\n", x, y);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, x, y;
  scanf("%d %d", a, b);
  x = a * b;
  y = 2 * (a + b);
  printf("%d %d", x, y);
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main(void) {
  // Your code here!
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d %d\\n", a * b, 2 * (a + b));
}


Error: TLE

Fixed submission:

#include <stdio.h>
char field[7][7] = {0};
int mem[7][7] = {0};
char x, y;
int cou = 0;
int o = 0;
int dx[4] = {0, -1, 0, 1}, dy[4] = {1, 0, -1, 0};
char jud[2] = {'o', 'x'};
int win[2] = {0};
int f = 0;

int in(char x, char y) {
  field[(x - 65) / 4 + (y - 65) / 4]
       [((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2] = '+';
  cou++;
  for (int i = 0; i < 4; i++) {
    if (((x - 65) / 4 + (y - 65) / 4) - dx[i] != -1 &&
        (((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2) - dy[i] != -1 &&
        ((x - 65) / 4 + (y - 65) / 4) - dx[i] != 7 &&
        (((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2) - dy[i] != 7) {
      mem[((x - 65) / 4 + (y - 65) / 4) - dx[i]]
         [(((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2) - dy[i]]++;
    }
  }
  return 0;
}

int che() {
  f = 0;
  for (int i = 1; i < 7; i = i + 2) {
    for (int j = 1; j < 7; j = j + 2) {
      if (mem[i][j] == 4) {
        f++;
        mem[i][j] = 0;
        field[i][j] = jud[o % 2];
        win[o % 2]++;
      }
    }
  }
  if (f == 0) {
    o++;
  }
  return 0;
}

int kar(char x, char y) {
  in(x, y);
  che();
  return 0;
}

int pri() {
  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < 7; j++) {
      printf("%c", field[i][j]);
    }
    printf("\\n");
  }
  printf("\\n");
  return 0;
}

int main() {
  int a = 0;
  printf("??£???????????????\\n\\n");
  printf("?????????????????????????????¢???????????????????????§????????§??\\???"
         "??????????????????\\n\\n");
  for (int i = 0; i < 8; i = i + 2) {
    for (int j = 0; j < 8; j = j + 2) {
      field[i][j] = a + 65;
      a++;
    }
  }
  while (cou < 24) {
    if (f != 0) {
      printf("?????? ");
    }
    if (o % 2 == 0) {
      printf("o?????????????????§???\\n\\n");
    } else {
      printf("x ??????????????§???\\n\\n");
    }
    pri();
    scanf(" %c %c", &x, &y);
    printf("\\n");
    if ('A' <= x && x <= 'Z' && 'A' <= y && y <= 'Z') {
      if (x - y == 1 || x - y == 4 || y - x == 1 || y - x == 4) {
        if (field[(x - 65) / 4 + (y - 65) / 4]
                 [((x - 65) % 4 * 2 + (y - 65) % 4 * 2) / 2] == '\\0') {
          kar(x, y);
        } else {
          printf("?????????????????????????????????\\n\\n");
        }
      } else {
        printf(
            "??£??\\????????¢???????????????????????\\?????????????????????\\n\\n");
      }
    } else {
      if ('a' <= x && x <= 'z' || 'a' <= y && y <= 'z') {
        printf("??§????????§??\\?????????????????????\\n\\n");
      } else {
        printf(
            "??§???????????¢????????????????????§??\\?????????????????????\\n\\n");
      }
    }
  }
  pri();
  if (win[0] > win[1]) {
    printf("o win\\n\\n");
  } else {
    printf("x win\\n\\n");
  }
  printf("o %d\\nx %d\\n", win[0], win[1]);
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {

  int x, y, a, b;

  scanf("%d", &x);
  scanf("%d", &y);

  a = x * y;
  b = (x * 2) + (y * 2);

  printf("%d %d\\n", a, b);
}

Error: -11

Fixed submission:

#include <stdio.h>

int main() {

  int x, y, a, b;

  scanf("%d", x);
  scanf("%d", y);

  a = x * y;
  b = (x * 2) + (y * 2);

  printf("%d %d\\n", a, b);
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main(void) {

  int a, b, c, d;

  scanf("%d", &a);

  scanf("%d", &b);

  c = a * b;

  d = (a * 2) + (b * 2);

  printf("%d %d\\n", c, d);

  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {

  int a, b, c, d;

  scanf("%d", a);

  scanf("%d", b);

  c = a * b;

  d = a * a + b * b;

  printf("%d %d\\n", c, d);

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

#include <iostream>
using namespace std;

int main() {

  int a, b;

  while (1) {
    cin >> a >> b;
    if (a < 1 || b > 100) {
      continue;
    } else {
      cout << a * b << " " << a * 2 + b * 2 << endl;
      break;
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {

  int a, b;

  while (1) {
    cin >> a;
    cin >> b;
    if (a < 1 || b > 100) {
      continue;
    } else {
      cout << a * b << " " << a * 2 + b * 2 << endl;
    }
  }

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

#include <stdio.h>
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d %d\\n", a * b, a + a + b + b);
}

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int a, b;
  scanf("%d %d", &a, b);
  printf("%d %d\\n", a * b, a + a + b + b);
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d %d\\n", a * b, 2 * a + 2 * b);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int a, b;
  scanf("%d %d", a, b);
  printf("%d\\n", a * b);
  printf("%d\\n", 2 * a + 2 * b);
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("%d %d\\n", a * b, 2 * a + 2 * b);

  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d", a);
  scanf("%d", b);
  printf("%d", a * b);

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

#include <stdio.h>
int main(void) {
  int a, b, menseki, syuu;
  scanf("%d %d", &a, &b);
  menseki = a * b;
  syuu = a * 2 + b * 2;
  printf("%d %d\\n", menseki, syuu);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {
  int a, b, menseki, syuu;
  scanf("%d %d", a, b);
  menseki = a * b;
  syuu = a * 2 + b * 2;
  printf("%d %d\\n", menseki, syuu);
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {
  int a, b, m, n;
  scanf("%d %d", &a, &b);

  m = a * b;
  n = 2 * a + 2 * b;

  printf("%d %d\\n", m, n);

  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main() {
  int a, b, m, n;
  scanf("%d %d", a, b);

  m = a * b;
  n = 2 * a + 2 * b;

  printf("%d %d", m, n);

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

#include <stdio.h>

int main(void) {
  int x, y;
  scanf("%d %d", &x, &y);
  int s = x * y;
  int l = 2 * (x + y);
  printf("%d %d\\n", s, l);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main(void) {
  int x, y;
  scanf("%d %d", x, y);
  printf("%d %d\\n", x * y, 2 * (x + y));
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <stdlib.h>

int main() {
  int x, y;
  std::cin >> x;
  std::cin >> y;

  int s = x * y;
  int l = 2 * x + 2 * y;
  std::cout << s << " " << l << std::endl;

  return 0;
}

Error: -11

Fixed submission:

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

int main(int argc, char *argv[]) {
  printf("%d", atoi(argv[1]));
  printf("1 4\\n");
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main(void) {
  int a, b;
  int x, y;

  scanf("%d %d", &a, &b);

  x = a * b;
  y = a * 2 + b * 2;

  printf("%d %d\\n", x, y);

  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main(void) {
  int a, b;
  int x, y;

  scanf("%d %d", a, b);

  x = a * b;
  y = a * 2 + b * 2;

  printf("%d %d/n", a, b);

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

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

int main() {
  int i, j;
  cin >> i >> j;
  int square, line;
  square = i * j;
  line = 2 * (i + j);
  cout << square << " " << line << endl;
  return 0;
}

Error: -11

Fixed submission:

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

int main(int argc, char *argv[]) {
  int i, j;
  i = atoi(argv[1]);
  j = atoi(argv[2]);
  int square, line;
  square = i * j;
  line = 2 * (i + j);
  cout << square << " " << line << endl;
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d ", a * b);
  printf("%d\\n", (a + b) * 2);
}

Error: -11

Fixed submission:

#include <stdio.h>

int main() {
  int a, b;
  scanf("%d %d", a, &b);
  printf("%d ", (a + b) * 2);
  printf("%d", a * b);
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main(void) {
  int x = 0;
  int y = 0;
  scanf("%d %d", &x, &y);
  printf("%d %d\\n", x * y, 2 * x + 2 * y);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {
  int x = 0;
  int y = 0;
  scanf("%d %d", x, y);
  printf("%d %d", x * y, 2 * (x + y));
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {

  int x1, x2, luas, luas1;
  scanf("%d %d", &x1, &x2);
  luas = x1 * x2;
  luas1 = (x1 + x2) * 2;
  printf("%d %d\\n", luas, luas1);

  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>

int main() {

  int angka1, angka2;
  scanf("%d %d", angka1, angka2);
  printf("%d %d\\n", angka1 * 3, (angka2 * 3) + 1);

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

#include <stdio.h>
int main(void) {
  int a, b;
  int syu;
  int menseki;

  scanf("%d%d", &a, &b);
  menseki = a * b;
  printf("%d", menseki);
  syu = a * 2 + b * 2;
  printf(" %d\\n", syu);
}

Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {
  int a, b;
  int syu;
  int menseki;

  scanf("%d%d", a, b);
  menseki = a * b;
  printf("%d");
  syu = a * 2 + b * 2;
  printf("%d");
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
  int x = 0, y = 0;
  scanf("%d %d", &x, &y);
  printf("%d %d\\n", x * y, x * 2 + y * 2);
  return 0;
}


Error: -11

Fixed submission:

#include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
  int x = 0, y = 0;
  scanf("%d %d", x, y);
  printf("%d %d\\n", x * y, x * 2 + y * 2);
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>

int main() {
  int a, b, c, d;
  scanf("%d %d", &a, &b);
  c = a * b;
  d = 2 * a + 2 * b;
  printf("%d %d\\n", c, d);

  return 0;
}

Error: -11

Fixed submission:

#include <cstdio>

int main() {
  int a, b, c, d;
  scanf("%d %d", a, b);
  c = a * b;
  d = 2 * a + 2 * b;
  printf("%d %d", c, d);
  return 0;
}