prithivMLmods/Coder-Stat huggingface dataset:
Problem p02386 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>

using namespace std;

struct dice {
  int u, n, e, s, w, d;
};

int main() {

  srand((unsigned)time(NULL));

  int n;
  dice d[100];
  int tmp;
  int q, a, b;
  int rn;
  int cnt = 0;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> d[i].u >> d[i].s >> d[i].e >> d[i].w >> d[i].n >> d[i].d;
  }

  for (int i = 1; i < n; i++) {
    cnt = 0;
    while (1) {
      rn = rand() % 4;
      if (rn == 0) {
        tmp = d[i].u;
        d[i].u = d[i].s;
        d[i].s = d[i].d;
        d[i].d = d[i].n;
        d[i].n = tmp;
      } else if (rn == 1) {
        tmp = d[i].u;
        d[i].u = d[i].w;
        d[i].w = d[i].d;
        d[i].d = d[i].e;
        d[i].e = tmp;
      } else if (rn == 2) {
        tmp = d[i].u;
        d[i].u = d[i].n;
        d[i].n = d[i].d;
        d[i].d = d[i].s;
        d[i].s = tmp;
      } else if (rn == 3) {
        tmp = d[i].u;
        d[i].u = d[i].e;
        d[i].e = d[i].d;
        d[i].d = d[i].w;
        d[i].w = tmp;
      }
      if (d[i].u == d[i - 1].u && d[i].w == d[i - 1].w &&
          d[i].e == d[i - 1].e && d[i].s == d[i - 1].s &&
          d[i].n == d[i - 1].n && d[i].d == d[i - 1].d) {
        cout << "No" << endl;
        return 0;
      }
      cnt++;
      if (cnt == 1000000) {
        break;
      }
    }
  }
  cout << "Yes" << endl;
}

Fixed submission:
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>

using namespace std;

struct dice {
  int u, n, e, s, w, d;
};

int main() {

  srand((unsigned)time(NULL));

  int n;
  dice d[100];
  int tmp;
  int q, a, b;
  int rn;
  int cnt = 0;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> d[i].u >> d[i].s >> d[i].e >> d[i].w >> d[i].n >> d[i].d;
  }

  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      cnt = 0;
      while (1) {
        rn = rand() % 4;
        if (rn == 0) {
          tmp = d[i].u;
          d[i].u = d[i].s;
          d[i].s = d[i].d;
          d[i].d = d[i].n;
          d[i].n = tmp;
        } else if (rn == 1) {
          tmp = d[i].u;
          d[i].u = d[i].w;
          d[i].w = d[i].d;
          d[i].d = d[i].e;
          d[i].e = tmp;
        } else if (rn == 2) {
          tmp = d[i].u;
          d[i].u = d[i].n;
          d[i].n = d[i].d;
          d[i].d = d[i].s;
          d[i].s = tmp;
        } else if (rn == 3) {
          tmp = d[i].u;
          d[i].u = d[i].e;
          d[i].e = d[i].d;
          d[i].d = d[i].w;
          d[i].w = tmp;
        }
        if (d[i].u == d[j].u && d[i].w == d[j].w && d[i].e == d[j].e &&
            d[i].s == d[j].s && d[i].n == d[j].n && d[i].d == d[j].d) {
          cout << "No" << endl;
          return 0;
        }
        cnt++;
        if (cnt == 10000) {
          break;
        }
      }
    }
  }
  cout << "Yes" << endl;
}
Problem p02386 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>
using namespace std;

class Dice {
public:
  long r[6];
  Dice(){};
  void roll(long a, long b, long c, long d) {
    swap(r[a], r[b]);
    swap(r[b], r[c]);
    swap(r[c], r[d]);
  }
  void spinW() { roll(0, 2, 5, 3); }
  void spinN() { roll(0, 1, 5, 4); }
};

int main() {
  int ans = 0;
  int n;
  cin >> n;
  vector<Dice> D(n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 6; j++)
      cin >> D[i].r[j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      char SWS[8] = {"NNNWNNN"};
      for (int k = 0; k < 8; k++) {
        if (D[i].r[1] == D[j].r[1])
          break;
        if (SWS[k] == 'W')
          D[j].spinW();
        else
          D[j].spinN();
      }
      for (int k = 0; k < 4; k++) {
        if (D[i].r[0] == D[j].r[0]) {
          if (D[i].r[1] == D[j].r[1] && D[i].r[2] == D[j].r[2] &&
              D[i].r[3] == D[j].r[3] && D[i].r[4] == D[j].r[4] &&
              D[i].r[5] == D[j].r[5])
            ans++;
        }
        D[j].spinW();
      }
    }
  }

  if (ans == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Fixed submission:
#include <iostream>
#include <vector>
using namespace std;

class Dice {
public:
  long r[6];
  Dice(){};
  void roll(long a, long b, long c, long d) {
    swap(r[a], r[b]);
    swap(r[b], r[c]);
    swap(r[c], r[d]);
  }
  void spinW() { roll(0, 2, 5, 3); }
  void spinN() { roll(0, 1, 5, 4); }
};

int main() {
  int ans = 0;
  int n;
  cin >> n;
  vector<Dice> D(n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 6; j++)
      cin >> D[i].r[j];
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      char SWS[8] = {"NNNWNNN"};
      for (int k = 0; k < 8; k++) {
        if (D[i].r[1] == D[j].r[1])
          break;
        if (SWS[k] == 'W')
          D[j].spinW();
        else
          D[j].spinN();
      }
      for (int k = 0; k < 4; k++) {
        if (D[i].r[0] == D[j].r[0]) {
          if (D[i].r[1] == D[j].r[1] && D[i].r[2] == D[j].r[2] &&
              D[i].r[3] == D[j].r[3] && D[i].r[4] == D[j].r[4] &&
              D[i].r[5] == D[j].r[5])
            ans++;
        }
        D[j].spinW();
      }
    }
  }

  if (ans == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}
Problem p02386 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

class Cube {
public:
  int f[6];
  Cube() {}
  void roll_z() { roll(1, 2, 4, 3); }
  void roll_y() { roll(0, 2, 5, 3); }
  void roll_x() { roll(0, 1, 5, 4); }
  void roll(int i, int j, int k, int l) {
    int t = f[i];
    f[i] = f[j];
    f[j] = f[k];
    f[k] = f[l];
    f[l] = t;
  }
};

bool eq(Cube c1, Cube c2) {
  for (int i = 0; i < 6; i++) {
    if (c1.f[i] != c2.f[i])
      return false;
  }
  return true;
}

bool equal(Cube c1, Cube c2) {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 4; j++) {
      if (eq(c1, c2))
        return true;
      c1.roll_z();
    }
    if (i % 2 == 0)
      c1.roll_y();
    else
      c1.roll_x();
  }
  return false;
}

Cube C[100];
int n;

bool check() {
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (equal(C[i], C[j]))
        return false;
    }
  }
  return true;
}

int main() {
  cin >> n;

  for (int j = 0; j < n; j++) {
    for (int i = 0; i < 6; j++)
      cin >> C[j].f[i];
  }

  if (check())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

class Cube {
public:
  int f[6];
  Cube() {}
  void roll_z() { roll(1, 2, 4, 3); }
  void roll_y() { roll(0, 2, 5, 3); }
  void roll_x() { roll(0, 1, 5, 4); }
  void roll(int i, int j, int k, int l) {
    int t = f[i];
    f[i] = f[j];
    f[j] = f[k];
    f[k] = f[l];
    f[l] = t;
  }
};

bool eq(Cube c1, Cube c2) {
  for (int i = 0; i < 6; i++) {
    if (c1.f[i] != c2.f[i])
      return false;
  }
  return true;
}

bool equal(Cube c1, Cube c2) {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 4; j++) {
      if (eq(c1, c2))
        return true;
      c1.roll_z();
    }
    if (i % 2 == 0)
      c1.roll_y();
    else
      c1.roll_x();
  }
  return false;
}

Cube C[100];
int n;

bool check() {
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (equal(C[i], C[j]))
        return false;
    }
  }
  return true;
}

int main() {
  cin >> n;

  for (int j = 0; j < n; j++) {
    for (int i = 0; i < 6; i++)
      cin >> C[j].f[i];
  }

  if (check())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}
Problem p02386 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

void roll(std::vector<int> &v, char c) {
  if (c == 'E') {
    char tmp = v[0];
    v[0] = v[3];
    v[3] = v[5];
    v[5] = v[2];
    v[2] = tmp;
  } else if (c == 'S') {
    char tmp = v[0];
    v[0] = v[4];
    v[4] = v[5];
    v[5] = v[1];
    v[1] = tmp;
  } else if (c == 'N') {
    char tmp = v[0];
    v[0] = v[1];
    v[1] = v[5];
    v[5] = v[4];
    v[4] = tmp;
  } else {
    char tmp = v[0];
    v[0] = v[2];
    v[2] = v[5];
    v[5] = v[3];
    v[3] = tmp;
  }
}

bool isSame(std::vector<int> v, std::vector<int> v2) {
  if (v[1] != v2[1]) {
    if (v2[4] == v[1])
      roll(v2, 'N');
    while (v2[0] != v[1])
      roll(v2, 'E');
    roll(v2, 'S');
  }

  for (int i = 0; i < 4; i++) {
    if (v == v2) {
      return true;
    }
    roll(v2, 'E');
  }
  return false;
}

int main() {
  int n;

  std::cin >> n;

  std::vector<std::vector<int>> v(n, std::vector<int>(6));

  for (int i = 0; i < n; i++) {
    scanf("%d %d %d %d %d %d", &v[i][0], &v[i][1], &v[i][2], &v[i][3], &v[i][4],
          &v[i][5]);
  }

  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (isSame(v[i], v[j])) {
        std::cout << "No" << std::endl;
        return 0;
      }
    }
  }

  std::cout << "Yes" << std::endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

void roll(std::vector<int> &v, char c) {
  if (c == 'E') {
    char tmp = v[0];
    v[0] = v[3];
    v[3] = v[5];
    v[5] = v[2];
    v[2] = tmp;
  } else if (c == 'S') {
    char tmp = v[0];
    v[0] = v[4];
    v[4] = v[5];
    v[5] = v[1];
    v[1] = tmp;
  } else if (c == 'N') {
    char tmp = v[0];
    v[0] = v[1];
    v[1] = v[5];
    v[5] = v[4];
    v[4] = tmp;
  } else {
    char tmp = v[0];
    v[0] = v[2];
    v[2] = v[5];
    v[5] = v[3];
    v[3] = tmp;
  }
}

bool isSame(std::vector<int> v, std::vector<int> v2) {
  std::vector<int> tmp, tmp2;
  tmp = v;
  tmp2 = v2;
  std::sort(tmp.begin(), tmp.end());
  std::sort(tmp2.begin(), tmp2.end());
  if (tmp != tmp2)
    return false;
  if (v[1] != v2[1]) {
    if (v2[4] == v[1])
      roll(v2, 'N');
    while (v2[0] != v[1])
      roll(v2, 'E');
    roll(v2, 'S');
  }

  for (int i = 0; i < 4; i++) {
    if (v == v2) {
      return true;
    }
    roll(v2, 'E');
  }
  return false;
}

int main() {
  int n;

  std::cin >> n;

  std::vector<std::vector<int>> v(n, std::vector<int>(6));

  for (int i = 0; i < n; i++) {
    scanf("%d %d %d %d %d %d", &v[i][0], &v[i][1], &v[i][2], &v[i][3], &v[i][4],
          &v[i][5]);
  }

  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (isSame(v[i], v[j])) {
        std::cout << "No" << std::endl;
        return 0;
      }
    }
  }

  std::cout << "Yes" << std::endl;
  return 0;
}
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = input()
print(x**3)


Fixed submission:
x = input()
x = int(x)
print(x**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = input()
print(x**3)


Fixed submission:
x = int(input())
print(x**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
n = input()
print(n * n * n)


Fixed submission:
s = input()
n = int(s)
print(n**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
num = input()

print(num**3)


Fixed submission:
num_str = input()
num = int(num_str)
print(num**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
print(input() ** 3)


Fixed submission:
i = int(input())
print(i**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
input = input()
print(input**3)


Fixed submission:
input = input()
print(int(input) ** 3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
print(input() ** 3)


Fixed submission:
print(int(input()) ** 3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = input()

print(x**3)


Fixed submission:
x = int(input())

print(x**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
N = input()
print(N**3)


Fixed submission:
N = int(input())
print(N**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = input()

ans = x * x * x

print(ans)


Fixed submission:
x = int(input())

ans = x * x * x

print(ans)
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

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

  return 0;
}

Fixed submission:
#include <stdio.h>

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

  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Time Limit Exceeded):
#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;
}


Fixed submission:
#include <iostream>

using namespace std;

int main() {
  int x, sum;

  cin >> x;

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

  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int x = 0;
  scanf("%d", x);
  printf("%d", x * x * x);
  return 0;
}

Fixed submission:
#include <stdio.h>
int main(void) {
  int x = 0;
  scanf("%d", &x);
  printf("%d\n", x * x * x);
  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int a;
  scanf("%d", a);
  printf("%d\n", a * a * a);
  return 0;
}

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 (status: Time Limit Exceeded):
#include <iostream>

using namespace std;

int Cubic(int x) { return (x * x * x); }

int main() {
  int x;

  cin >> x;

  x = Cubic(x);

  cout << x << endl;

  while (1)
    ;

  return 0;
}

Fixed submission:
#include <iostream>

using namespace std;

int Cubic(int x) { return (x * x * x); }

int main() {
  int x;

  cin >> x;

  x = Cubic(x);

  cout << x << endl;

  // while(1);

  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int x;
  scanf("%d", x);
  printf("%d\n", x * x * x);
}

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

Buggy submission (status: Runtime Error):
#include <stdio.h>

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

Fixed submission:
#include <stdio.h>

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

Buggy submission (status: Runtime Error):
#include <iostream>

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

Fixed submission:
#include <iostream>

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

Buggy submission (status: Runtime Error):
x = input(())

print(x**3)


Fixed submission:
x = int(input())

print(x**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
print(int(input) ** 3)


Fixed submission:
print(int(input()) ** 3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
import sys

args = sys.argv

num = int(args[1])
print(str(num**3))


Fixed submission:
s = input()
num = int(s)
print(str(num**3))
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = input()

print(x * x * x)


Fixed submission:
x = int(input())
print(x * x * x)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = input()
print(x**3)


Fixed submission:
input_1 = int(input())
cal = (input_1) ** 3
print(cal)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = input()
y = x**3
print(y)


Fixed submission:
x = input()
print(x**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
x = int(input())
print(**3)


Fixed submission:
x = int(input())
print(x**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
s = input("")
ans = s * s * s
print(ans)


Fixed submission:
user = input("")
num = int(user)
ans = num * num * num
print(ans)
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main(void) {
  int x;
  scanf("%d", x);
  printf("%d", x * 2);
  return 0;
}


Fixed submission:
#include <stdio.h>

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

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

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

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;
  return x * x * x;
}

Fixed submission:
#include <iostream>
using namespace std;

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

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int a;
  scanf("%d", a);
  printf("%d", a * a * a);
}


Fixed submission:
#include <stdio.h>
int main() {
  int a, b;
  scanf("%d", &a);
  b = a * a * a;
  printf("%d\n", b);
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

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

Fixed submission:
#include <stdio.h>

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

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {

  int x;

  scanf("%d", x);

  x = x * x * x;

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

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 (status: Runtime Error):
#include <iostream>
using namespace std;

int main(int x) { return x * x * x; }

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;
  cout << x * x * x << endl;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main(void) {
  int x;

  scanf("%d", x);
  printf("%d", x * x * x);

  return 0;
}


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 (status: Runtime Error):
#include <stdio.h>

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


Fixed submission:
#include <stdio.h>

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

Buggy submission (status: Runtime Error):
number = input(int())
print(number**3)


Fixed submission:
number = int(input())
print(number**3)
Problem p02388 (Python)

Buggy submission (status: Runtime Error):
print(int(input() ** 3))


Fixed submission:
print(int(input()) ** 3)
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int x;

  scanf("%d", x);
  printf("%d", x * x * x);

  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int x;

  scanf("%d", &x);

  x = x * x * x;

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

  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>

#define OK 1;
using namespace std;

int main(void) {
  int x;

  // scanf
  cin >> x;

  // printf
  cout << x * x * x << endl;

  return OK;
}

Fixed submission:
#include <iostream>

#define OK 0;
using namespace std;

int main(void) {
  int x;

  // scanf
  cin >> x;

  // printf
  cout << x * x * x << endl;

  return OK;
}
Problem p02388 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main(void) {

  int x = 5;
  int sum = 1;
  do {
    cin >> x;
  } while (1 <= x && x <= 1000);

  for (int i = 0; i <= 2; i++) {
    sum *= x;
  }
  cout << sum << endl;

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main(void) {

  int x = 5;
  int sum = 1;
  cin >> x;

  for (int i = 0; i <= 2; i++) {
    sum *= x;
  }
  cout << sum << endl;

  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {
  int x, ans;
  scanf("%d", x);

  ans = x * x * x;

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

  return 0;
}

Fixed submission:
#include <stdio.h>

int main() {
  int x, ans;
  scanf("%d", &x);

  ans = x * x * x;

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

  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int x;
  do {
    cin >> x;
  } while (x >= 1 && x <= 100);
  cout << (x * x * x) << endl;
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;
  cout << x * x * x << endl;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int x, ans = 0;
  scanf("%d", x);
  ans = x * x * x;
  printf("%d\n", ans);
  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int x, ans = 0;
  scanf("%d", &x);
  ans = x * x * x;
  printf("%d\n", ans);
  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

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


Fixed submission:
#include <stdio.h>

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

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int x = 0;
  scanf("%d", x);
  printf("%d\n", &x);
  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int x = 0;
  scanf("%d", &x);
  printf("%d\n", x * x * x);
  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
using namespace std;
int main() {
  int w = 0;
  scanf("%d", &w);
  printf("%d\n", w * w * w);
  return 8;
}

Fixed submission:
#include <stdio.h>
using namespace std;
int main() {
  int w = 0;
  scanf("%d", &w);
  printf("%d\n", w * w * w);
  return 0;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#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;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;
  cout << x * x * x << endl;
}
Problem p02388 (C++)

Buggy submission (status: 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 argc, char *argv[]) {
  double y = pow(charToDouble(argv[1]), 3);
  std::cout << doubleToString(y) << std::endl;
}

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 x;
  std::cin >> x;
  double y = pow(double(x), 3);
  std::cout << doubleToString(y) << std::endl;
}
Problem p02388 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>
int main() {
  int a, b;
  scanf("%d", a);
  b = a * a * a;
  printf("%d\n", b);
  return 0;
}

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 (status: 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;
}


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 (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int x, y;
  scanf("%d", x);
  y = x * x * x;
  printf("%d\n", y);
  return 0;
}


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 (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

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

Fixed submission:
#include <iostream>
using namespace std;

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

Buggy submission (status: 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;
}

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 (status: 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;
}

Fixed submission:
#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;
}
Problem p02389 (C++)

Buggy submission (status: 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;
}


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 (status: Runtime Error):
#include <stdio.h>
using namespace std;
int main(void) {
  // Your code here!
  int a, b;
  scanf("%d %d", a, b);
  printf("%d %d\n", 2 * (a + b), a * b);
}


Fixed submission:
#include <stdio.h>
using namespace std;
int main(void) {
  // Your code here!
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d %d\n", a * b, 2 * (a + b));
}
Problem p02389 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

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

Fixed submission:
#include <stdio.h>

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

Buggy submission (status: 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);
}

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 (status: Runtime Error):
#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;
}

Fixed submission:
#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;
}
Problem p02389 (C++)

Buggy submission (status: 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);
}

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 (status: Runtime Error):
#include <stdio.h>

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

  return 0;
}

Fixed submission:
#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;
}
Problem p02389 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {

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

  return 0;
}


Fixed submission:
#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;
}
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
a, b = [int(elem) for elem in input().split]
print(a * b, (a + b) * 2)


Fixed submission:
a, b = [int(elem) for elem in input().split()]
print(a * b, (a + b) * 2)
Problem p02389 (C++)

Buggy submission (status: Runtime Error):
#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;
}


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 (Python)

Buggy submission (status: Runtime Error):
nums = list(map(int, input().split(" ")))
area = nums[0] * nums[1]
perimeter = nums[0] * 2 + nums[1] * 2
print(area + " " + perimeter)


Fixed submission:
nums = list(map(int, input().split(" ")))
area = nums[0] * nums[1]
perimeter = nums[0] * 2 + nums[1] * 2
print(str(area) + " " + str(perimeter))
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
line = int(input().split)

area = line[0] * line[1] % 2

peri = line[0] * 2 + line[1] * 2

print(area + " " + peri)


Fixed submission:
if __name__ == "__main__":
    x = input()
    a = int(x.split(" ")[0])
    b = int(x.split(" ")[1])
    print(a * b, (a + b) * 2)
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
nums = input().split()
x = nums[0] * nums[1]
y = nums[0] * 2 + nums[1] * 2
print(str(x) + " " + str(y))


Fixed submission:
nums = [int(e) for e in input().split()]
x = nums[0] * nums[1]
y = nums[0] * 2 + nums[1] * 2
print(str(x) + " " + str(y))
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
a, b = [int(x) for x in input().split(" ")]

print("{} {}".format(a * b, 2 * a + 2 * b))


Fixed submission:
a, b = [int(x) for x in input().split()]

print("{} {}".format(a * b, 2 * a + 2 * b))
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
a, b = map(int, input().split())
print(a * b, 2(a + b))


Fixed submission:
a, b = map(int, input().split())
print(a * b, 2 * (a + b))
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
x = int(input().split(" "))
a = x[0] * x[1]
b = x[0] + x[1] + x[0] + x[1]
print(str(a) + str(b))


Fixed submission:
x = input().split(" ")
a = int(x[0]) * int(x[1])
b = int(x[0]) + int(x[1]) + int(x[0]) + int(x[1])
print(str(a) + " " + str(b))
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
a, b = map(int, input().splot())
print(str(a * b) + str(2 * a + 2 * b))


Fixed submission:
a, b = map(int, input().split())
print(str(a * b) + " " + str(2 * a + 2 * b))
Problem p02389 (Python)

Buggy submission (status: Runtime Error):
n = input()
a, b = int(n.split())
x = a * b
y = 2 * (a + b)
print(x, y)


Fixed submission:
n = input()
a, b = n.split()
a = int(a)
b = int(b)
x = a * b
y = 2 * (a + b)
print(x, y)
Problem p02389 (C++)

Buggy submission (status: Runtime Error):
#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;
}

Fixed submission:
#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;
}
Problem p02390 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int main() {
  int S1, h, m, s;
  cin >> S1;
  h = S1 / 60 / 60;
  m = h % h;
  s = m % m;
  cout << h << ':' << m << ':' << s << endl;
  return 0;
}


Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int S1, h, m, s;
  cin >> S1;
  h = S1 / 3600;
  m = S1 % 3600 / 60;
  s = S1 % 60;
  cout << h << ':' << m << ':' << s << endl;
  return 0;
}
Problem p02390 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
int main() {
  int S, h = 0, m = 0;
  std::cin >> S;
  while (S / 3600 > 0) {
    h++;
    S = S - 3600;
  }
  while (S / 60 > 0) {
    m++;
    m = m - 60;
  }
  std::cout << h << ":" << m << ":" << S << std::endl;
}

Fixed submission:
#include <iostream>
int main() {
  int S, h = 0, m = 0;
  std::cin >> S;
  h = S / 3600;
  S = S % 3600;
  m = S / 60;
  S = S % 60;
  std::cout << h << ":" << m << ":" << S << std::endl;
}
Problem p02390 (Python)

Buggy submission (status: Runtime Error):
sec = int(input())
tmp = [sec // 3600, (sec // 60) % 60, sec % 60]
print(":".join(tmp))


Fixed submission:
sec = int(input())
tmp = map(str, [sec // 3600, (sec // 60) % 60, sec % 60])
print(":".join(tmp))
Problem p02390 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {
  int x, h, m, s;
  scanf("%d", x);

  h = x / 3600;
  m = x % 3600 / 60;
  s = x % 60;

  printf("%d:%d:%d\n", h, m, s);

  return 0;
}

Fixed submission:
#include <stdio.h>

int main() {
  int x, h, m, s;
  scanf("%d", &x);

  h = x / 3600;
  m = x % 3600 / 60;
  s = x % 60;

  printf("%d:%d:%d\n", h, m, s);

  return 0;
}
Problem p02390 (Python)

Buggy submission (status: Runtime Error):
S = int(input())
h = S // 3600
m = (S % 3600) // 60
s = (S % 3600) % 60
print(":".join[h, m, s])


Fixed submission:
S = int(input())
h = S // 3600
m = (S % 3600) // 60
s = (S % 3600) % 60
print(str(h) + ":" + str(m) + ":" + str(s))
Problem p02390 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int s, m, h;
  scanf("%d", s);
  h = s / 3600;
  m = (s - 3600 * h) / 60;
  s -= 3600 * h + 60 * m;
  printf("%d:%d:%d\n", h, m, s);
  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int s, h, m;
  scanf("%d", &s);
  h = (int)s / 3600;
  m = (int)(s - 3600 * h) / 60;
  s = s - (int)(3600 * h + 60 * m);
  printf("%d:%d:%d\n", h, m, s);
  return 0;
}
Problem p02390 (Python)

Buggy submission (status: Runtime Error):
sho = int(input()) // 60
amari = int(input()) % 60

h = sho // 60
m = sho % 60
s = amari

print("{}:{}:{}".format(h, m, s))


Fixed submission:
sho, s = divmod(int(input()), 60)
h, m = divmod(sho, 60)
print("{}:{}:{}".format(h, m, s))
Problem p02390 (Python)

Buggy submission (status: Runtime Error):
x = input()
s = x % 60
x //= 60
m = x % 60
x //= 60
print("{}:{}:{}".format(x, m, s))


Fixed submission:
x = int(input())
s = x % 60
x //= 60
m = x % 60
x //= 60
print("{}:{}:{}".format(x, m, s))
Problem p02390 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int h, m, s;
int main() {
  cin >> s;

  h = s / 3600;
  m = (s % 3600) / 60;
  s = s % 60;

  printf("%s:%s:%s", h, m, s);

  return 0;
}

Fixed submission:
#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int h, m, s;
int main() {
  cin >> s;

  h = s / 3600;
  m = (s % 3600) / 60;
  s = s % 60;

  printf("%d:%d:%d\n", h, m, s);

  return 0;
}
Problem p02391 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {
  int a, b;

  scanf("%d", &a);
  scanf("%d", b);
  if (a < b)
    printf("a < b\n");
  if (a > b)
    printf("a > b\n");
  if (a == b)
    printf("a == b\n");
  return 0;
}

Fixed submission:
#include <stdio.h>

int main() {
  int a, b;

  scanf("%d", &a);
  scanf("%d", &b);
  if (a < b)
    printf("a < b\n");
  if (a > b)
    printf("a > b\n");
  if (a == b)
    printf("a == b\n");
  return 0;
}
Problem p02391 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d %d", a, b);
  if (a < b) {
    printf("a < b\n");
  } else {
    if (a > b) {
      printf("a > b\n");
    } else {
      if (a == b) {
        printf("a == b\n");
      }
    }
  }
  return 0;
}

Fixed submission:
#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a < b) {
    printf("a < b\n");
  } else {
    if (a > b) {
      printf("a > b\n");
    } else {
      if (a == b) {
        printf("a == b\n");
      }
    }
  }
  return 0;
}
Problem p02391 (Python)

Buggy submission (status: Runtime Error):
string = input()
a, b = input().split(" ")
if a > b:
    print("a > b")
elif a < b:
    print("a < b")
else:
    print("a == b")


Fixed submission:
string = input()
a, b = map(int, (string.split(" ")))
if a > b:
    print("a > b")
elif a < b:
    print("a < b")
else:
    print("a == b")
Problem p02391 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int a, b;

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

  if (a > b) {
    printf("a > b\n");
  }

  if (a < b) {
    printf("a < b\n");
  }

  if (a == b) {
    printf("a == b\n");
  }

  return 0;
}


Fixed submission:
#include <stdio.h>
int main(void) {
  int a, b;

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

  if (a > b) {
    printf("a > b\n");
  }

  if (a < b) {
    printf("a < b\n");
  }

  if (a == b) {
    printf("a == b\n");
  }

  return 0;
}
Problem p02391 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d%d", &a, &b);
  char s;
  if (a > b)
    s = '>';
  else if (a == b)
    s = '=';
  else
    s = '<';
  if (s != '=')
    printf("a %s b\n", s);
  else
    printf("a == b\n");
  return 0;
}


Fixed submission:
#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d%d", &a, &b);
  char s;
  if (a > b)
    s = '>';
  else if (a == b)
    s = '=';
  else
    s = '<';
  if (s != '=')
    printf("a %c b\n", s);
  else
    printf("a == b\n");
  return 0;
}
Problem p02391 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

int main() {

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

  printf("a %s b\n", a, (a < b) ? "<" : (a == b) ? "==" : ">", b);
}


Fixed submission:
#include <bits/stdc++.h>

int main() {

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

  printf("a %s b\n", (a < b) ? "<" : (a == b) ? "==" : ">");
}
Problem p02391 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
int main() {
  int a, b;
  for (;;) {
    cin >> a >> b;
    if (a < b) {
      cout << "a < b" << endl;
    } else if (a > b) {
      cout << "a > b" << endl;
    } else if (a == b) {
      cout << "a == b" << endl;
    }
  }
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  if (a < b) {
    cout << "a < b" << endl;
  } else if (a > b) {
    cout << "a > b" << endl;
  } else if (a == b) {
    cout << "a == b" << endl;
  }
  return 0;
}
Problem p02391 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int a, b;
  scanf("%d %d", a, b);
  if (a > b) {
    printf("a>b\n");
  } else if (a < b) {
    printf("a<b\n");
  } else {
    printf("a==b\n");
  }
  return 0;
}

Fixed submission:
#include <stdio.h>
int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a >= -1000 && a <= 1000 && b >= -1000 && b <= 1000) {
    if (a > b) {
      printf("a > b\n");
    } else if (a < b) {
      printf("a < b\n");
    } else {
      printf("a == b\n");
    }
  }
  return 0;
}
Problem p02392 (Python)

Buggy submission (status: Runtime Error):
a, b, c = map(int, input.split())
if a < b < c:
    print("Yes")
else:
    print("No")


Fixed submission:
a, b, c = map(int, input().split())
if a < b < c:
    print("Yes")
else:
    print("No")
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int a, b, c;
  scanf("%d %d %d", a, b, c);

  if (a < b && b < c)

  {
    printf("Yes\n");
  }

  else {
    printf("No\n");
  }

  return 0;
}


Fixed submission:
#include <stdio.h>
int main(void) {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);

  if (a < b && b < c)

  {
    printf("Yes\n");
  }

  else {
    printf("No\n");
  }

  return 0;
}
Problem p02392 (Python)

Buggy submission (status: Runtime Error):
d = input()
a, b, c = map(d.split())

if (a < b) and (b < c):
    print("Yes")
else:
    print("No")


Fixed submission:
d = input()
a, b, c = map(int, d.split())
if (a < b) and (b < c):
    print("Yes")
else:
    print("No")
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {

  int a, b, c;
  scanf("%d %d %d", a, b, c);
  if (a < b && a < c && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}


Fixed submission:
#include <stdio.h>

int main() {

  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  if (a < b && a < c && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int a, b, c;
  scanf("%d %d %d", a & a, &b, &c);
  if (a < b && b < c)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}

Fixed submission:
#include <stdio.h>
int main(void) {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  if (a < b && b < c)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int a, b, c;
  scanf("%d %d %d", a, b, c);
  if (a < b && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  if (a < b && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>

int main() {
  int a, b, c;
  scanf("%d %d %d", a, b, c);
  if (a < b && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
}

Fixed submission:
#include <cstdio>

int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  if (a < b && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int a, b, c;
  scanf("%d", a);
  scanf("%d", b);
  scanf("%d", c);
  if (a < b && b < c)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int a, b, c;
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  if (a < b && b < c)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int a, b, c;
  scanf("%d", a);
  scanf("%d", b);
  scanf("%d", c);
  if (a < b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


Fixed submission:
#include <stdio.h>
int main(void) {
  int a, b, c;
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  if (a < b && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {

  int a, b, c;

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

  if (a < b && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}

Fixed submission:
#include <stdio.h>

int main() {

  int a, b, c;

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

  if (a < b && b < c) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>

int main() {
  // 入力
  int a, b, c;
  std::scanf("%d%d%d", a, b, c);

  if (a < b && b < c) {
    std::printf("Yes");
  } else {
    std::printf("No");
  }
  std::printf("\n");

  return 0;
}


Fixed submission:
#include <cstdio>

int main() {
  // 入力
  int a, b, c;
  std::scanf("%d%d%d", &a, &b, &c);

  if (a < b && b < c) {
    std::printf("Yes");
  } else {
    std::printf("No");
  }
  std::printf("\n");

  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <stdlib.h>
using namespace std;

int main(void) {

  int a, b, c;
  cin >> a >> b >> c;
  if (a < b) {
    if (b < c) {
      cout << "Yes" << endl;
      exit(1);
    }
  }
  cout << "No" << endl;
  return 0;
}

Fixed submission:
#include <iostream>
#include <stdlib.h>
using namespace std;

int main(void) {

  int a, b, c;
  cin >> a >> b >> c;
  if (a < b) {
    if (b < c) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
Problem p02392 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int a, b, c;
  scanf("%d %d %d", a, b, c);
  if (a < b && b < c)
    printf("Yes\n");
  else
    printf("No\n");

  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  if (a < b && b < c)
    printf("Yes\n");
  else
    printf("No\n");

  return 0;
}
Problem p02393 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int a, b, c, tmp;
  cin >> a >> b >> c;

  while (!(a < b && b < c)) {
    if (a > b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    if (b > c) {
      tmp = b;
      b = c;
      c = tmp;
    }
  }

  cout << a << " " << b << " " << c << endl;
  ;

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int a, b, c, tmp;
  cin >> a >> b >> c;

  while (!(a <= b && b <= c)) {
    if (a > b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    if (b > c) {
      tmp = b;
      b = c;
      c = tmp;
    }
  }

  cout << a << " " << b << " " << c << endl;
  ;

  return 0;
}
Problem p02393 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

// ポインタ渡しによる解法

void swap(int *a, int *b);

int main() {

  int a, b, c;

  cin >> a >> b >> c;

  if (a > b)
    swap(&a, &b);
  if (b > c)
    swap(&b, &c);

  if (a > b)
    swap(&a, &b);

  cout << a << " " << b << " " << c << endl;

  while (1) {
  }

  return 0;
}

void swap(int *a, int *b) {

  int temp = *a;
  *a = *b;
  *b = temp;
}


Fixed submission:
#include <iostream>
using namespace std;

// ポインタ渡しによる解法

void swap(int *a, int *b);

int main() {

  int a, b, c;

  cin >> a >> b >> c;

  if (a > b)
    swap(&a, &b);
  if (b > c)
    swap(&b, &c);

  if (a > b)
    swap(&a, &b);

  cout << a << " " << b << " " << c << endl;

  return 0;
}

void swap(int *a, int *b) {

  int temp = *a;
  *a = *b;
  *b = temp;
}
Problem p02393 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int t = 0;
loop:;
  t = 0;
  if (a > b) {
    t = t + 1;
    swap(a, b);
  }
  if (b > c) {
    t = t + 1;
    swap(a, b);
  }
  if (t != 0) {
    goto loop;
  }
  cout << a << " " << b << " " << c << endl;
  return 0;
}


Fixed submission:
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int t = 0;
loop:;
  t = 0;
  if (a > b) {
    t = t + 1;
    swap(a, b);
  }
  if (b > c) {
    t = t + 1;
    swap(b, c);
  }
  if (t != 0) {
    goto loop;
  }
  cout << a << " " << b << " " << c << endl;
  return 0;
}
Problem p02393 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <cstdio>

int main() {
  int x, y, z;
  scanf("%d %d %d", &x, &y, &z);

  int a[3] = {x, y, z}, buff = 0;

  while (1) {
    for (int i = 0; i < 3; i++) {
      for (int j = i; j < 3; j++) {
        if (a[i] > a[j]) {
          buff = a[j];
          a[j] = a[i];
          a[i] = buff;
        }
      }
    }
    if (a[0] < a[1] && a[1] < a[2])
      break;
  }

  printf("%d %d %d\n", a[0], a[1], a[2]);
  return 0;
}

Fixed submission:
#include <cstdio>

int main() {
  int x, y, z;
  scanf("%d %d %d", &x, &y, &z);

  int a[3] = {x, y, z}, buff = 0;

  while (1) {
    for (int i = 0; i < 3; i++) {
      for (int j = i; j < 3; j++) {
        if (a[i] > a[j]) {
          buff = a[j];
          a[j] = a[i];
          a[i] = buff;
        }
      }
    }
    if (a[0] <= a[1] && a[1] <= a[2])
      break;
  }

  printf("%d %d %d\n", a[0], a[1], a[2]);
  return 0;
}