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

#include <iostream>
using namespace std;

int main() {
  int a;
  int b;
  a = 0;
  b = 0;
  cin >> a >> b;
  if (a < 1) {
    return 0;
  } else {
    if (b > 100) {
      return 0;
    } else {
      cout << a * b << " " << a + b + a + b << endl;
    }
  }
  return 0;
}

Error: 1

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  unsigned int a;
  unsigned int b;
  a = 0;
  b = 0;
  cin >> a >> b;
  if (a < 1) {
    return 1;
  } else {
    if (b < 100) {
      return 1;
    } else {
      cout << a * b << a + b + a + b << endl;
    }
  }
  return 0;
}
Problem p02389 (C++) — buggy submission, verdict: 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", a * b, 2 * (a + b));
}


Error: -11

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", 2 * (a + b), a * b);
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>

using namespace std;

int main() {
  int s;

  cin >> s;
  int h = s / 3600;
  s %= 3600;
  int m = s / 60;
  s %= 60;
  cout << h << ":" << m << ":" << s << endl;

  return 0;
}

Error: 1

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  unsigned int s;
  s = 0;
  cin >> s;
  if (s = 86400) {
    return 1;
  } else if (s > 86400) {
    return 1;
  } else {
    unsigned int hour;
    unsigned int minute;
    unsigned int second;
    hour = s / 216000;
    minute = (s - (hour * 21600)) / 3600;
    second = s - (s - (s - (hour * 21600)) * 3600) / 60;
    cout << hour << ":" << minute << ":" << second << endl;
  }
  return 0;
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int S, h, m, s;
  cin >> S;
  h = S / 3600;
  m = S % 3600 / 60;
  s = S % 3600 % 60;
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}


Error: -11

Fixed submission:

#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  int S, M, L, base = 1000;
  scanf("%d %d %d", S & M & L);
  base += S;
  base += M + L;
  printf("%d\\n", base);

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

#include <iostream>
using namespace std;

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

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

  cout << h << ":" << m << ":" << s << endl;

  return 0;
}

Error: -8

Fixed submission:

#include <iostream>
using namespace std;

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

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

  cout << h << ":" << m << ":" << s << endl;

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

#include <iostream>

int h = 0, m = 0, s = 0;

int main() {
  std::cin >> s;
  for (; s >= 60;) {
    m += 1;
    s -= 60;
  }
  for (; m >= 60;) {
    h += 1;
    m -= 60;
  }
  std::cout << h << ":" << m << ":" << s << std::endl;
}

Error: TLE

Fixed submission:

#include <iostream>

int h = 0, m = 0, s = 0;

int main() {
  std::cin >> s;
  for (; s < 60;) {
    m += 1;
    s -= 60;
  }
  for (; m < 60;) {
    h += 1;
    m -= 60;
  }
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error


#include <cstdio>
#include <iostream>
using namespace std;
int main() {

  int x, s, m, h;
  cin >> x;

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

  cout << h << ":" << m << ":" << s << endl;

  return 0;
}


Error: WA

Fixed submission:

#include <cstdio>
#include <iostream>
using namespace std;
int main() {

  int x, s, m, h;
  cin >> x >> s >> m >> h;

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

  cout << h << ":" << m << ":" << s;

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

#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;
}

Error: -11

Fixed submission:

#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;
}
Problem p02390 (C++) — buggy submission, verdict: 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("%d:%d:%d\\n", h, m, s);

  return 0;
}

Error: -11

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("%s:%s:%s", h, m, s);

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

#include <stdio.h>
int main() {
  int t1;
  scanf("%d", &t1);
  printf("%d:%d:%d\\n", (t1 / 3600), ((t1 % 3600) / 60), ((t1 % 3600) % 60));
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main() {
  int t1;
  scanf("%d", t1);
  printf("%d:%d:%d\\n", (t1 / 3600), ((t1 % 3600) / 60), ((t1 % 3600) % 60));
  return 0;
}
Problem p02390 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int sec, h, m, s;
  cin >> sec;

  for (h = 0;; h++) {
    if (3600 <= sec) {
      sec -= 3600;
    } else {
      break;
    }
  }
  for (m = 0;; m++) {
    if (60 <= sec) {
      sec -= 60;
    } else {
      break;
    }
  }

  cout << h << ":" << m << ":" << sec;

  cout << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int sec, h, m, s;
  cin >> sec;

  for (h = 0;; h++) {
    if (3600 <= sec) {
      sec -= 3600;
    }
  }
  for (m = 0;; m++) {
    if (60 <= sec) {
      sec -= 60;
    }
  }

  cout << h << ":" << m << ":" << sec;

  cout << endl;
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

#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;
}


Error: WA

Fixed submission:

#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;
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int S, h, m, s;
  cin >> S;
  h = S / 3600;
  S = S % 3600;
  m = S / 60;
  s = S % 60;
  cout << h << ":" << m << ":" << s << '\\n';
  return 0;
}

Error: -11

Fixed submission:

#include <cstdio>
int main() {
  int S, h, m;
  scanf("%d", S);
  h = S / 3600;
  m = (S - 3600 * h) / 60;
  printf("%d:%d:%d", h, m, S);
  return 0;
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

//
//  main.c
//  Hellow World
//
//  Created by 郷田将 on 2018/02/06.
//  Copyright © 2018年 郷田将. All rights reserved.
//

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

void watch(int second) {
  int hour;
  int min;
  int sec;

  char time[50];

  hour = (int)(second / 3600);
  min = (int)(second / 60 - hour * 60);
  sec = (int)(second % 60);

  sprintf(time, "%d:%d:%d", hour, min, sec);
  printf("%s\\n", time);

  return;
}

int main() {

  int second;

  scanf("%d", &second);
  watch(second);

  return 0;
}


Error: 0

Fixed submission:

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

void watch(int second) {
  int hour;
  int min;
  int sec;

  char time[50];

  hour = (int)(second / 3600);
  min = (int)(second / 60 - hour * 60);
  sec = (int)(second % 60);

  sprintf(time, "%d:%d:%d", hour, min, sec);
  printf("%s\\n", time);

  return;
}

int main() {
  char *str;

  int second;

  scanf("%s", str);

  second = atoi(str);

  watch(second);

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

#include <stdio.h>

int main() {
  int S;
  scanf("%d", &S);
  int h, m, s;
  h = S / 3600;
  m = (S % 3600) / 60;
  s = S % 60;
  printf("%d:%d:%d\\n", h, m, s);
}


Error: -6
*** stack smashing detected ***: terminated


Fixed submission:

#include <stdio.h>

int main() {
  int S;
  scanf("%S", &S);
  int h, m, s;
  h = S / 3600;
  m = S / 60;
  s = S % 60;
  printf("%d:%d:%d\\n", h, m, s);
}
Problem p02390 (C++) — buggy submission, verdict: Time Limit Exceeded

#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;
}

Error: TLE

Fixed submission:

#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;
}
Problem p02390 (C++) — buggy submission, verdict: 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;
}

Error: -11

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 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int h, m, s;
  cin >> s;
  h = s / 3600;
  s %= 3600;
  m = s / 60;
  s %= 60;
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}


Error: -8

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int h, m, s;
  cin >> s;
  h = s / 3600;
  s %= h;
  m = s / 60;
  s %= m;
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}
Problem p02390 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>

int main() {
  int S;

  scanf("%d", &S);

  if (0 <= S && S < 86400) {
    int h = S / 3600;
    int m = (S - h * 3600) / 60;
    int s = (S - h * 3600) - (m * 60);
    printf("%d:%d:%d\\n", h, m, s);
  } else {
    printf("error");
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>

int main() {
  int S;

  while (1) {
    scanf("%d", &S);
    if (!S)
      break;

    if (0 <= S && S < 86400) {
      int h = S / 3600;
      int m = (S - h * 3600) / 60;
      int s = (S - h * 3600) - (m * 60);
      printf("%d:%d:%d\\n", h, m, s);
    } else {
      printf("error");
    }
  }
  return 0;
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int S;
  cin >> S;

  int h, a, m, b, s;

  h = S / 3600; // 何時間
  a = S % 3600; // 残り秒数
  m = a / 60;   // 何分
  b = a % 60;   // 残り秒数
  s = b;

  cout << h << ":" << m << ":" << s << endl;
}


Error: -8

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x;
  cin >> x;

  int a, b, c, d;
  a = x / 3600; // 何時間
  b = x % a;    // 残りの秒
  c = a / 60;   // 何分
  d = a % c;    // 残り秒
  cout << a << ":" << c << ":" << d << endl;
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int h, m, s;
  cin >> s;
  h = s / 3600;
  s %= 3600;
  m = s / 60;
  s %= 60;
  cout << h << ":" << m << ":" << s << endl;
}

Error: -8

Fixed submission:

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

int main() {
  int h, m, s;
  cin >> s;
  h = s / 60 * 60;
  s %= s / 60 * 60;
  m = s / 60;
  s %= s / 60;
  cout << h << ":" << m << ":" << s << endl;
}
Problem p02390 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {

  int n, m = 0, h = 0, rst = 0, s = 0;

  cin >> n;

  if (n == 0) {
    cout << "0:0:0" << endl;
    return 0;
  }
  if (n < 60) {
    cout << "0:0:" << n;
    return 0;
  }

  h = n / 3600;
  rst = n % 3600;
  if (rst == 0) {
    s == 0;
    m == 0;
  }

  else {
    m = rst / 60;
    s = rst % 60;
  }
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}


Error: 0

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int n, m, h, r, s;
  cin >> n;
  if (n > 84600) {
    cin >> n;
  }
  if (n == 0) {
    goto out;
  out:
    cout << "0"
         << ":"
         << "0"
         << ":"
         << "0" << endl;
    return 0;
  }
  h = n / 3600;
  r = n % 3600;
  m = r / 60;
  s = r % (m * 60);
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}
Problem p02392 (C++) — buggy submission, verdict: 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;
}

Error: -11

Fixed submission:

#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;
}
Problem p02392 (C++) — buggy submission, verdict: 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;
}

Error: -11

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, verdict: Runtime Error

#include <iostream>

using namespace std;

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

Error: 1

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a > b) {
    cout << "no";
    return 0;
  }
  if (b > c) {
    cout << "no";
    return 0;
  }
  cout << "yes";
  return true;
}
Problem p02392 (C++) — buggy submission, verdict: 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;
}


Error: -11

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, verdict: 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;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}

Error: 1

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;
      exit(1);
    }
  }
  cout << "No" << endl;
  return 0;
}
Problem p02392 (C++) — buggy submission, verdict: 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;
}

Error: -11

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, verdict: Runtime Error

#include <stdio.h>
using namespace std;

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;
}


Error: -11

Fixed submission:

#include <stdio.h>
using namespace std;

int main() {
  int a, b, c;
  scanf("%d %d %d", a, b, c);
  if ((a < b) && (b < c)) {
    printf("Yes");
  } else {
    printf("No");
  }
  return 0;
}
Problem p02392 (C++) — buggy submission, verdict: 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);
}

Error: -11

Fixed submission:

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

#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;
}


Error: -11

Fixed submission:

#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;
}
Problem p02392 (C++) — buggy submission, verdict: 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;
}


Error: -11

Fixed submission:

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

  if (a < b < c)
    printf("Yes\\n");

  else
    printf("No\\n");

  return 0;
}
Problem p02392 (C++) — buggy submission, verdict: 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;
}

Error: -11

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, verdict: 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;
}

Error: -11

Fixed submission:

#include <stdio.h>

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

  return 0;
}
Problem p02392 (C++) — buggy submission, verdict: 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");
  }
}

Error: -11

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, verdict: 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;
}


Error: -11

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, verdict: 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;
}


Error: -11

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, verdict: 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;
}

Error: -11

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, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int a = 0;
  int b = 0;
  int c = 0;

  cin >> a >> b >> c;
  if (a >= 0 && a <= 10000 && a <= 10000 && b >= 0 && b <= 10000 && c >= 0 &&
      c <= 10000) {

    if (a <= b && b <= c && a <= c) {
      cout << a << " " << b << " " << c << endl;
    } else if (a <= b && b >= c && a <= c) {
      cout << a << " " << c << " " << b << endl;
    } else if (a >= b && b <= c && a <= c) {
      cout << b << " " << a << " " << c << endl;
    } else if (a >= b && b <= c && a >= c) {
      cout << b << " " << c << " " << a << endl;
    } else if (a >= b && b >= c && a >= c) {
      cout << c << " " << b << " " << a << endl;
    } else if (a <= b && b >= c && a >= c) {
      cout << c << " " << a << " " << b << endl;
    }
  }
  return 0;
}


Error: 255

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a = 0;
  int b = 0;
  int c = 0;

  cin >> a >> b >> c;
  if (a >= 0 && a <= 10000 && a <= 10000 && b >= 0 && b <= 10000 && c <= 0 &&
      c >= 10000) {

    if (a <= b && b <= c && a <= c) {
      cout << a << " " << b << " " << c << endl;
    } else if (a <= b && b >= c && a <= c) {
      cout << a << " " << c << " " << b << endl;
    } else if (a >= b && b <= c && a <= c) {
      cout << b << " " << a << " " << c << endl;
    } else if (a >= b && b <= c && a >= c) {
      cout << b << " " << c << " " << a << endl;
    } else if (a >= b && b >= c && a >= c) {
      cout << c << " " << b << " " << a << endl;
    } else if (a <= b && b >= c && a >= c) {
      cout << c << " " << a << " " << b << endl;
    }

    return 0;
  } else {
    return -1;
  }
}
Problem p02393 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int a, b, c, e;
  int d = 0;

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

  while (d == 0) {
    if (a > b) {
      e = a;
      a = b;
      b = e;
    }
    if (b > c) {
      e = b;
      b = c;
      c = e;
    }
    if (a <= b) {
      if (b <= c) {
        d = 1;
      }
    }
  }
  printf("%d %d %d\\n", a, b, c);
  return 0;
}

Error: TLE

Fixed submission:

#include <math.h>
#include <stdio.h>
int main() {
  int a, b, c, e;
  int d = 0;

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

  while (d == 0) {
    if (a > b) {
      e = a;
      a = b;
      b = e;
    }
    if (b > c) {
      e = b;
      b = c;
      c = e;
    }
    if (a < b) {
      if (b < c) {
        d = 1;
      }
    }
  }
  printf("%d %d %d\\n", a, b, c);
  return 0;
}
Problem p02393 (C++) — buggy submission, verdict: 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;
}

Error: TLE

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, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PI;

int main() {
  int a[3];
  for (int i = 0; i < 3; i++)
    cin >> a[i];
  sort(a, a + 3);
  cout << a[0] << " " << a[1] << " " << a[2] << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PI;

int main() {
  int a[3];
  for (int i = 0; i < 3; i++)
    cin >> a[i];
  sort(a, a + 3);
  for (int e : a)
    cout << e << " ";
  cout << endl;
  return 0;
}