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

#include <stdio.h>
int main(void) {
  int a, b, d, r;
  double f;
  scanf("%d", &a);
  scanf("%d", &b);
  d = a / b;
  r = a % b;
  f = (double)a / (double)b;
  printf("%d %d %f", d, r, f);

  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {
  int a, b, d, r;
  double f;
  scanf("%d", a);
  scanf("%d", b);
  d = a / b;
  r = a % b;
  f = a / b;
  printf("%d %d %f", d, r, f);

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

#include <cstdio>

using namespace std;

int main(void) {
  int a, b;

  scanf("%d%d", &a, &b);
  printf("%d %d %.5f", a / b, a % b, (double)a / (double)b);

  return 0;
}

Error: -11

Fixed submission:

#include <cstdio>

using namespace std;

int main(void) {
  int a, b;

  scanf("%d%d", a, b);
  printf("%d %d %.5f", a / b, a % b, (double)a / (double)b);

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

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

int main() {
  int a, b;
  std::cin >> a >> b;
  printf("%d %d %.5lf\\n", a / b, a % b, (double)a / b);
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>

int main() {
  int a, b;
  std::cout << a / b << " " << a % b << " " << (float)a / b << '\\n';
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

Error: WA

Fixed submission:

#include <stdio.h>
int main() {
  int a, b;
  printf("%d %d %d", a / b, a % b, (double)a / b);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Time Limit Exceeded

/**
 * ?????????

???????????´??° a ??¨ b
?????????????????§?????\\?????????????¨??????????????????°?????????????????????????????????

a ?? b ??? d (??´??°)
a ?? b ????????? ??? r (??´??°)
a ?? b ??? f (???????°???°?????°)
Input
1?????????????????´??° a, b ????????????????????????

Output
d, r, f
????????????????????§????????£????????????????????????????????????f??????????????????0.00001??\\????????????????????£????????????????????¨????????????

Constraints
1 ??? a, b ??? 10^9
Sample Input
3 2
Sample Output
1 1 1.50000

 */

#include <iomanip>
#include <iostream>
#include <sstream>

int main(int argc, char const *argv[]) {
  unsigned int a, b, d, r;
  a = b = 1;
  d = r = 0;
  double f = 0;

  while (true) {
    std::string param;

    getline(std::cin, param);
    std::istringstream iss(param);
    iss >> a >> b;

    if ((a < 1 || a > 1000000000) || (b < 1 || b > 1000000000)) {
      std::cout << "Error: 1 <= a, b <= 1000000000" << std::endl;
    } else {
      break;
    }
  }

  d = a / b;
  r = a % b;
  f = (double)a / (double)b;

  std::cout << std::fixed << std::setprecision(5);
  std::cout << d << " " << r << " " << f << std::endl;

  return 0;
}

Error: TLE

Fixed submission:

/**
 * ?????????

???????????´??° a ??¨ b
?????????????????§?????\\?????????????¨??????????????????°?????????????????????????????????

a ?? b ??? d (??´??°)
a ?? b ????????? ??? r (??´??°)
a ?? b ??? f (???????°???°?????°)
Input
1?????????????????´??° a, b ????????????????????????

Output
d, r, f
????????????????????§????????£????????????????????????????????????f??????????????????0.00001??\\????????????????????£????????????????????¨????????????

Constraints
1 ??? a, b ??? 109
Sample Input
3 2
Sample Output
1 1 1.50000

 */

#include <iomanip>
#include <iostream>
#include <sstream>

int main(int argc, char const *argv[]) {
  unsigned int a, b, d, r;
  a = b = 1;
  d = r = 0;
  double f = 0;

  while (true) {
    std::string param;

    getline(std::cin, param);
    std::istringstream iss(param);
    iss >> a >> b;

    if ((a < 1 || a > 109) || (b < 1 || b > 109)) {
      std::cout << "Error: 1 <= a, b <= 109" << std::endl;
    } else {
      break;
    }
  }

  d = a / b;
  r = a % b;
  f = (double)a / (double)b;

  std::cout << std::fixed << std::setprecision(5);
  std::cout << d << " " << r << " " << f << std::endl;

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

#include <cstdio>

using namespace std;

int main() {
  int a, b, d, r;
  double f;

  scanf("%d%d", &a, &b);
  d = a / b;
  r = a % b;
  f = 1.00 * a / b;
  printf("%d %d %.6lf\\n", d, r, f);

  return 0;
}

Error: -11

Fixed submission:

#include <cstdio>

using namespace std;

int main(void) {
  int a, b, d, r;
  double f;

  scanf("%d%d", a, b);
  d = a / b;
  r = a % b;
  f = (double)a / b;
  printf("%d %d %f\\n", d, r, f);

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

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

  double a1, b1, f;
  int a2, b2, d, r;

  scanf("%lf", &a1);
  scanf("%lf", &b1);
  a2 = a1;
  b2 = b1;
  d = a2 / b2;
  r = a2 % b2;
  f = a1 / b1;
  printf("%d %d %f\\n", d, r, f);
  return (0);
}

Error: TLE

Fixed submission:

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

  double a, b;
  int d, r;
  double f;

  scanf("%lf", &a);
  scanf("%lf", &b);
  r = a;
  f = a / b;
  for (d = 0; r >= b; d++) {
    r -= b;
  }
  printf("%d %d %.5f\\n", d, r, f);
  return (0);
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int a, b, d, r;
  double f;
  cin >> a >> b;
  d = a / b;
  r = a % b;
  f = (double)a / b;
  cout << d << " " << r << " " << fixed << f << endl;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a;
  int b;
  int d = a / b;
  int r = a % b;
  double f = (double)a / b;
  cin >> a >> b;
  cout << d << " " << r << " " << f << endl;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main(void) {
  int a, b, d, r;
  double f;
  scanf("%d", &a);
  scanf("%d", &b);
  d = a / b;
  r = a % b;
  f = (double)a / b;
  printf("%d %d %.5lf\\n", d, r, f);
  return 0;
}

Error: -8

Fixed submission:

#include <stdio.h>
int main(void) {
  int a, b, d, r;
  double f;
  scanf("%lf", &a);
  scanf("%lf", &b);
  d = a / b;
  r = a % b;
  f = a / b;
  printf("%d %d %.5lf\\n", d, r, f);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  cout << fixed << setprecision(12);
  int a, b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " " << (double)a / b << endl;
  return 0;
}


Error: WA

Fixed submission:

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

int main() {
  cout << fixed << setprecision(12);
  int a, b;
  cin >> a, b;
  cout << a / b << " " << a % b << " " << (double)a / b << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>

using namespace std;

int main() {
  long a, b;
  cin >> a >> b;
  long d = a / b;
  long r = a % b;

  cout << d << " " << r << " " << d << ".";
  for (int i = 0; i < 5; ++i) {
    int k = -1;
    while (r != 0 && r < b) {
      r *= 10;
      ++k;
    }
    long rr = r / b;
    r %= b;
    for (int j = 0; j < k; ++j)
      cout << 0;
    cout << rr;
  }
  cout << endl;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>

using namespace std;

int main() {
  long a, b;
  cin >> a >> b;
  long d = a / b;
  long r = a % b;

  cout << d << " " << r << " " << d << ".";
  for (int i = 0; i < 5; ++i) {
    int k = -1;
    while (r < b) {
      r *= 10;
      ++k;
    }
    long rr = r / b;
    r %= b;
    for (int j = 0; j < k; ++j)
      cout << 0;
    cout << rr;
  }
  cout << endl;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <cmath>
#include <cstdio>

using namespace std;

int main() {
  int a, b;
  int d, r;
  double f;

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

  d = a / b;
  r = a % b;
  f = 1.0 * a / b;

  printf("%d %d %f\\n", d, r, f);

  return 0;
}

Error: WA

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  float a, b, f;
  int d, r;

  d = (int)a / (int)b;
  r = (int)a % (int)b;
  f = a / b;

  cout << d << " " << r << " " << f << endl;

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

#include <cstdio>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " ";
  cout << fixed << setprecision(7);
  cout << (double)a / b << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <cstdio>
#include <iomanip>
#include <iostream>
int main() {
  int a, b;
  std::cout << a / b << std::endl;
  std::cout << a % b << std::endl;
  double f;
  f = 1.0 * a / b;
  std::cout << std::fixed;
  std::cout << std::setprecision(5) << f << std::endl;

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

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

int main() {
  double a, b, df, r;
  cin >> a >> b;
  df = a / b;
  r = (int)a % (int)b;
  cout << (int)df << " " << r << " " << fixed << setprecision(5) << df << endl;
  return 0;
}


Error: -8

Fixed submission:

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

int main() {
  double a, b, df, r;
  df = a / b;
  r = (int)a % (int)b;
  cout << (int)df << " " << r << " " << fixed << setprecision(5) << df << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>

using namespace std;

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

  cout << a / b << " " << a % b << " " << setiosflags(ios::fixed)
       << setprecision(10) << ((double)a) / b << endl;

  return 0;
}

Error: WA

Fixed submission:

#include <iomanip>
#include <iostream>

using namespace std;

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

  cout << a / b << " " << a % b << " " << setprecision(10) << ((double)a) / b
       << endl;
  system("pause");
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

Error: -8

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, c, d, r;
  double f;
  scanf("%d,%d", &a, &b);
  d = a / b;
  r = a % b;
  f = a % b;
  printf("%d %d %lf\\n", d, r, f);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int nA, nB;
  cin >> nA >> nB;
  int nD, nR;
  double dF;
  nD = nA / nB;
  nR = nA % nB;
  dF = nA / (double)nB;
  cout << nD << " " << nR << " ";
  printf("%.8f\\n", dF);

  // system("pause");
  return 0;
}

Error: WA

Fixed submission:

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

int main() {
  int nA, nB;
  cin >> nA >> nB;
  int nD, nR;
  double dF;
  nD = nA / nB;
  nR = nA % nB;
  dF = (double)nA / nB;
  cout << nD << " " << nR << " ";
  cout << setprecision(9) << dF << endl;

  system("pause");
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

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

  cout << a / b << ' ' << a % b << ' ';
  cout << fixed << setprecision(5) << static_cast<double>(a) / b << endl;
}


Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b;

  cout << a / b << ' ' << a % b << ' ' << static_cast<float>(a) / b << endl;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {
  int a, b, d, r;
  double f;
  scanf("%ld%ld", &a, &b);
  d = a / b;
  r = a % b;
  f = (double)a / b;

  printf("%ld %ld %lf\\n", d, r, f);

  return 0;
}


Error: WA

Fixed submission:

#include <stdio.h>

int main() {
  int a, b, d, r;
  double f;
  scanf("%9d%9d", &a, &b);
  d = a / b;
  r = a % b;
  f = (double)a / b;

  printf("%9d %9d %14.5f\\n", d, r, f);

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

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  long a, b, d, r;
  double f;
  cin >> a >> b;
  d = a / b;
  r = a % b;
  f = (double)a / b;
  printf("%d %d %lf\\n", d, r, f);
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, d, r;
  float f;
  cin >> a, b;
  d = a / b;
  r = a % b;
  f = (float)a / b;
  cout << d << " " << r << " " << f << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cctype>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>

using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  int d = a / b;
  int r = a % b;
  double f = 1.0 * a / b;
  printf("%d %d %.5lf\\n", d, r, f);
  // while(1);
  return 0;
}


Error: WA

Fixed submission:

#include <algorithm>
#include <cctype>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>

using namespace std;

int main() {
  int a, b;
  int d = a / b;
  int r = a % b;
  double f = 1.0 * a / b;
  printf("%d %d %.5lf\\n", d, r, f);
  // while(1);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int a, b, d, r;
  double f;
  cin >> a >> b;

  d = a / b;
  r = a % b;
  f = 1.0 * a / b;
  printf("%d %d %.5f", d, r, f);

  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, d, r, h, j;
  double f;
  cin >> a >> b >> h >> j;

  d = a / b;
  r = a % b;
  f = h / j;
  printf("%d %d %.5f", d, r, f);

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

#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  double c = 1.0000 * a / b;
  cout << a / b << " " << a % b << " " << fixed << c << endl;
  return 0;
}

Error: WA

Fixed submission:

#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  double c = a / b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " " << fixed << c << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>

int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d %d %lf\\n", a / b, a % b, (double)a / b);
  return 0;
}

Error: -8

Fixed submission:

#include <cstdio>

int main() {
  float a, b;
  scanf("%lf%lf", &a, &b);
  printf("%d %d %lf\\n", (int)(a / b), (int)a % (int)b, a / b);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a, b, d, r;
  double f;
  scanf("%d %d", &a, &b);
  d = a / b;
  r = a % b;
  f = 1.00000000000000 * a / b;
  printf("%d %d %.14lf\\n", d, r, f);
  return 0;
}

Error: WA

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, d, r;
  double f;
  d = a / b;
  r = a % d;
  f = a / b;
  printf("%d %d %.8lf\\n", d, r, f);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  double da = a, db = b;
  printf("%d %d %f\\n", a / b, a % b, da / db);
  return 0;
}

Error: TLE

Fixed submission:

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

  int a, b;
  char op;
  while (true) {
    cin >> a >> op;
    if (op == '?')
      break;
    cin >> b;
    if (op == '+')
      cout << a + b << endl;
    if (op == '-')
      cout << a - b << endl;
    if (op == '*')
      cout << a * b << endl;
    if (op == '/')
      cout << a / b << endl;
  }

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

// Tuvshee

#include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define I int
#define D double
#define F float
#define C char
#define S string
#define B bool
#define L long long
#define rep(n) for (int i = 0; i < n; i++)
#define reps(m, n, c) for (int c = m; c < n; c++)
#define repd(m, n, j) for (int j = n; j > m; j--)
#define whL while
#define eL endl
#define oR ||
#define anD &&
#define rtn return
#define pause system("PAUSE")
#define Max 300
#define max(m, n) ((n < m) ? m : n)
#define min(m, n) ((n > m) ? m : n)

int main() {
  I m, n;
  cin >> m >> n;
  cout << m / n << ' ' << m % n << ' ' << setprecision(5) << fixed
       << double(m) / n << eL;
  rtn 0;
}

Error: 0
sh: 1: PAUSE: not found


Fixed submission:

// Tuvshee

#include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define I int
#define D double
#define F float
#define C char
#define S string
#define B bool
#define L long long
#define rep(n) for (int i = 0; i < n; i++)
#define reps(m, n, c) for (int c = m; c < n; c++)
#define repd(m, n, j) for (int j = n; j > m; j--)
#define whL while
#define eL endl
#define oR ||
#define anD &&
#define rtn return
#define pause system("PAUSE")
#define Max 300
#define max(m, n) ((n < m) ? m : n)
#define min(m, n) ((n > m) ? m : n)

int main() {
  I m, n;
  cin >> m >> n;
  cout << m / n << ' ' << m % n << ' ' << setprecision(5) << fixed
       << double(m) / n << eL;
  pause;
  rtn 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int x, y;
  cin >> x >> y;
  cout << x / y << ' ' << x % y << ' ';
  double d_x = x;
  double d_y = y;
  cout << fixed << setprecision(6) << d_x / d_y << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, y;
  cout << x / y << ' ' << x % y << ' ';
  double d_x = x;
  double d_y = y;
  cout << d_x / d_y << endl;
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main(void) {
  int H, W, i, n;
  while (1) {
    scanf("%d %d", &H, &W);
    if (H == 0 && W == 0)
      break;
    for (i = 0; i < H; i++) {
      for (n = 0; n < W - 1; n++) {
        printf("#");
      }
      printf("#\\n");
    }
    printf("\\n");
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>
int main() {
  int H, W, i;
  while (1) {
    scanf("%d %d", &H, &W);
    if ((H = 0) && (W = 0))
      break;
    for (i = 0; i < H; i++) {
      for (i = 0; i < W; i++) {
        printf("#");
      }
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int H, W;

  int i = 0;
  int j = 0;
  int num = 0;
  while (num < 1000) {

    cin >> H >> W;
    if (H != 0 && W != 0) {
      while (i < H) {

        while (j < W) {
          cout << "#";
          j++;
        }
        cout << endl;
        j = 0;
        i++;
      }
      cout << endl;
      i = 0;
    }
    if (H == 0 && W == 0) {
      break;
    }
  }
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int H, W;
  cin >> H >> W;

  int i = 0;
  int j = 0;
  int num = 0;
  while (num < 1000) {

    if (H != 0 && W != 0) {
      while (i < H) {

        while (j < W) {
          cout << "#";
          j++;
        }
        cout << endl;

        i++;
      }
    }
    if (H == 0 && W == 0) {
      break;
    }
  }
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int W, H;
  while (1) {
    cin >> W >> H;
    if (H == 0 && W == 0)
      break;
    else
      for (int j = 0; j < W; j++) {
        for (int i = 0; i < H; i++) {
          cout << "#";
        }
        cout << endl;
      }
    cout << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

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

int main() {
  int H, W;
  cin >> H >> W;
  while (1) {
    if (H == 0 && W == 0)
      break;
    else
      for (int j = 0; j < W; j++) {
        for (int i = 0; i < H; i++) {
          cout << "#";
        }
        cout << endl;
      }
    cout << endl;
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int H, W;
  while (1) {
    cin >> H >> W;
    if (H == 0 && W == 0)
      break;

    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        cout << "#";
      }
      cout << "\\n";
    }
    cout << endl;
  }
  // your code goes here
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int H, W;
  while (1) {
    cin >> H >> W;
    if (H == 0 && W == 0)
      break;

    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; W++) {
        cout << "#";
      }
      cout << "\\n";
    }
    cout << endl;
  }

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

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

  int h, w;
  int i, j;

  while (1) {

    scanf("%d %d", &h, &w);
    if (h == 0 && w == 0)
      break;

    for (i = 0; i < h; i++) {
      for (j = 0; j < w; j++) {
        printf("#");
      }
      printf("\\n");
    }
    printf("\\n");
  }
  return 0;
}

Error: TLE

Fixed submission:

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

  int h, w;
  int i, j;

  while (1) {

    scanf("%d %d", &h, &w);

    for (i = 0; i < h; i++) {
      for (j = 0; j < w; j++) {
        printf("#");
      }
      printf("\\n");
    }
    printf("\\n");

    if (h = 0, w = 0) {
      break;
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <math.h>
#include <stdio.h>
#define PI 3.1415926535897932384626433832795028841971
using namespace std;

int main() {
  int w, h;

  while (true) {
    cin >> h >> w;
    if (w == 0 && h == 0) {
      break;
    }

    for (int hh = 0; hh < h; hh++) {
      for (int ww = 0; ww < w; ww++) {
        cout << '#';
      }
      cout << endl;
    }
    cout << endl;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <math.h>
#include <stdio.h>
#define PI 3.1415926535897932384626433832795028841971
using namespace std;

int main() {
  int w, h;

  while (true) {
    cin >> w >> h;

    for (int hh = 0; hh < h; hh++) {
      for (int ww = 0; ww < w; ww++) {
        cout << '#';
      }
      cout << endl;
    }
    cout << endl;
  }

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

//
//  main.cpp
//  hello
//
//  Created by 王　暁彬 on 2018/03/13.
//  Copyright © 2018年 Home. All rights reserved.
//
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
  while (1) {
    int a, b;
    cin >> a >> b;
    if (a == 0 && b == 0)
      break;
    for (int i = 0; i < a; i++) {
      for (int j = 0; j < b; j++) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
  while (1) {
    int a, b;
    cin >> a >> b;
    if (a == b == 0)
      break;
    for (int i = 0; i < a; i++) {
      for (int j = 0; j < b; j++) {
        cout << "#";
      }
      cout << endl;
    }
  }
}