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

#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  while (true) {
    int h, w;
    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 << endl;
    }
    cout << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  while (true) {
    int h, w;
    cin >> h >> w;
    for (int i = 0; i < h; i++) {
      for (int j = 0; j < w; j++) {
        cout << '#';
      }
      cout << endl;
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int h, w;
  while (true) {
    cin >> h >> w;
    if ((h | w) != 0) {
      for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
          cout << "#";
        }
        cout << endl;
      }
      cout << endl;
    } else {
      break;
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

#include <iostream>
using namespace std;
int main(void) {
  // Your code here!
  int W, H;

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

    for (int i = 1; i <= H; i++) {
      for (int j = 1; j <= W; j++) {
        cout << '#' << flush;
      }
      cout << '\\n';
    }
    cout << '\\n';
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  // Your code here!
  int W, H, i, j;
  cin >> W, H;
  while (1) {
    if (W == 0 && H == 0)
      break;

    for (j = 1; j <= H; j++) {
      for (i = 1; i <= W; i++) {
        cout << '#' << flush;
      }
      cout << '\\n' << endl;
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int tate, yoko;

  while (true) {
    cin >> tate >> yoko;
    if (tate == 0 && yoko == 0)
      break;
    for (int i = 0; i < tate; i++)
      for (int j = 1; j <= yoko; j++) {
        if (j < yoko)
          cout << "#";
        else
          cout << "#"
               << "\\n";
      }
    cout << "\\n";
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int tate, yoko;
  cin >> tate >> yoko;
  while (true) {

    if (tate == 0 && yoko == 0)
      break;
    for (int i = 0; i < tate; i++)
      for (int j = 1; j <= yoko; j++) {
        if (j < yoko)
          cout << "#";
        else
          cout << "#"
               << "\\n";
      }
  }
  cout << "\\n";
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main(void) {
  int H, W, i;

  while (cin >> H >> W) {
    if (H == 0 || W == 0) {
      break;
    }

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

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  int H, W;
  cin >> H >> W;
  while (1) {
    if (H == 0 || W == 0) {
      break;
    }

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

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

#include <iostream>
#include <string>
#include <vector>

using namespace std;

string put_nchar(int n, char c) {
  string S(n, c);

  return S;
}

void print_rectangle(int W, int H, char c) {
  for (int i = 0; i < H; i++) {
    cout << put_nchar(W, c) << endl;
  }
}

int main() {
  vector<int> W, H;

  while (true) {
    int H1, W1;

    cin >> H1 >> W1;

    if (H1 == 0 && W1 == 0) {
      break;
    }

    H.push_back(H1);
    W.push_back(W1);
  }

  for (vector<int>::size_type i = 0; i < H.size(); i++) {
    print_rectangle(W[i], H[i], '#');

    cout << endl;
  }

  return 0;
}

Error: -6
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc


Fixed submission:

#include <iostream>
#include <string>
#include <vector>

using namespace std;

string put_nchar(int n, char c) {
  string S(n, c);

  return S;
}

void print_rectangle(int W, int H, char c) {
  for (int i = 0; i < H; i++) {
    cout << put_nchar(W, c) << endl;
  }
}

int main() {
  vector<int> W, H;

  while (true) {
    int W1, H1;

    cin >> W1 >> H1;

    W.push_back(W1);
    H.push_back(H1);
  }

  for (vector<int>::size_type i = 0; i < W.size(); i++) {
    print_rectangle(W[i], H[i], '#');

    cout << endl;
  }

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

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
  int H, W;
  while (cin >> H >> W) {
    if (H == 0 && W == 0)
      break;
    for (int i = 1; i <= H; i++) {
      for (int j = 1; j < W; j++) {
        cout << "#";
      }
      cout << "#" << endl;
    }
    cout << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int tate, yoko, i, j;
  while (1) {
    cin >> tate >> yoko;
    for (i = 0; i < tate; i++) {
      for (j = 0; j < yoko; j++) {
        cout << "#";
      }
      cout << endl;
    }
  }

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

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

Error: TLE

Fixed submission:

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

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
  int H;
  int W;
  int j;
  int i;
  for (H = 1, W = 1;;) {
    cin >> H >> W;
    if (H == 0 && W == 0)
      break;
    for (i = 0; i < H; i++) {
      for (j = 0; j < W; j++) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
  int H;
  int W;
  int j;
  int i;
  for (H = 1, W = 1;;) {
    if (H > 0 && W > 0)
      cin >> H >> W;
    cout << endl;
    for (i = 0; i < H; i++) {
      for (j = 0; j < W; j++) {
        cout << "#";
      }
      cout << endl;
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
long long a[10005];
int main() {
  int H, W, i = 0, j = 0;
  bool b = false;
  while (cin >> H >> W) {
    if (H == 0 && W == 0) {
      cout << endl;
      break;
    }
    if (b == true)
      cout << endl;
    b = true;
    for (i = 0; i < H; i++) {
      for (j = 0; j < W; j++) {
        cout << "#";
      }
      cout << endl;
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
long long a[10005];
int main() {
  int H, W, i, j;
  cin >> H >> W;
  i = 0;
  j = 0;
  while (H != 0 || W != 0) {
    for (i = 0; i < H; i++) {
      for (j = 0; j < W; j++) {
        cout << "#";
      }
      cout << endl;
    }
  }
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int w, h, a, b;
  while (1) {
    cin >> h >> w;
    h, w <= 300;
    a = 1;
    if (w == 0 && h == 0)
      break;
    while (a <= h) {
      b = 1;
      for (b = 1; b <= w; b++) {
        cout << "#";
      }
      a += 1;
      cout << endl;
    }
    cout << endl;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int w, h, a, b;
  cin >> h >> w;
  a = 1;
  h, w <= 300;
  while (1) {
    if (w == 0 && h == 0)
      break;
    while (a <= h) {
      b = 1;
      for (b = 1; b <= w; b++) {
        cout << "#";
      }
      a += 1;
      cout << endl;
    }
    cout << endl;
  }
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <vector>

using namespace std;

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

    if (H == 0 && W == 0) {
      return 0;
    }

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

Error: TLE

Fixed submission:

#include <iostream>
#include <vector>

using namespace std;

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

    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
  }
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int H, W;
  cin >> H >> W;
  while ((H != 0) || (W != 0)) {
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
    cin >> H >> W;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int H, W;
  cin >> H >> W;
  while ((H != 0) || (W != 0)) {
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        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 (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 << endl;
    }
    cout << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

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

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int h, w;
  cin >> h >> w;

  for (int i = 0; i < h; i++) {
    for (int j = 0; i < w; j++) {
      cout << "#";
    }
    cout << endl;
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
int main() {
  int i, j, h, w, g;
  while (1) {
    cin >> 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");
  }
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
int main() {
  int i, j, h, w, g;
  while (1) {
    cin >> h >> w;
    if (h == 0 && w == 0) {
      break;
    }
    for (i = 0; i < h; i++) {
      for (j = 0; j < w; w++) {
        printf("#");
      }
      printf("\\n");
    }
  }
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>
int main() {
  int H, W;
  while (1) {
    scanf("%d %d", &H, &W);
    if (!W && !H) {
      break;
    }
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        putchar('#');
      }
      putchar('\\n');
    }
    putchar('\\n');
  }
}

Error: TLE

Fixed submission:

#include <cstdio>
int main() {
  int W, H;
  while (1) {
    scanf("%d %d", &W, &H);
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        putchar('#');
      }
      putchar('\\n');
    }
    putchar('\\n');
  }
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {

  int h, w;

  while (true) {

    cin >> h >> w;

    if (h == 0 && w == 0)
      break;

    for (int i = 0; i + 1 <= h; i++) {

      for (int j = 0; j + 1 <= w; j++) {

        cout << "#";
      }
      cout << endl;
    }

    cout << endl;
  }

  // cin >> /*変数他*/;
  // cout << /*文字列*/ << endl;
}


Error: TLE

Fixed submission:


#include <iostream>

using namespace std;

int h, w;

int main() {

  cin >> h >> w;
  if (h != 0 || w != 0) {

    for (int i = 0; i + 1 >= h; i++) {

      for (int j = 0; j + 1 >= w; j++) {

        cout << "#";
      }
      cout << endl;
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

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

    for (int i = 1; i <= a; i++) {
      for (int j = 1; j <= b; j++) {
        cout << '#';
      }
      cout << endl;
    }
    cout << endl;
    cin >> a >> b;
  }
}


Error: TLE

Fixed submission:

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

    for (int i = 1; i <= a; i++) {
      for (int j = 1; j <= b; j++) {
        cout << '#';
      }
      cout << endl;
    }
    cout << endl;
  }
  cin >> a >> b;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  while (1) {
    int H, W;
    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 << endl;
    }
    cout << endl;
  }

  return 0;
}


Error: TLE

Fixed submission:

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

int main() {
  while (1) {
    int H, W;
    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 << endl;
    }
    cout << endl;
  }

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


#include <cstdio>

int main() {
  int H, W;
  for (;;) {
    scanf("%d %d\\n\\n", &H, &W);
    if (H == 0 && W == 0) {
      break;
    }
    for (int i = 1;; i++) {
      for (int j = 1;; j++) {
        printf("#");
        if (j == W) {
          printf("\\n");
          break;
        }
      }
      if (i == H) {
        printf("\\n");
        break;
      }
    }
  }
  return 0;
}


Error: TLE

Fixed submission:


#include <cstdio>

int main() {
  int H, W;
  for (;;) {
    if (H == 0 && W == 0) {
      break;
    }
    scanf("%d %d\\n\\n", &H, &W);
    for (int i = 1;; i++) {
      for (int j = 1;; j++) {
        printf("#");
        if (j == W) {
          printf("\\n");
          break;
        }
      }
      if (i == H) {
        printf("\\n");
        break;
      }
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int h, w, i, j;
  for (;;) {
    cin >> h >> w;
    if (h == 0 && w == 0) {
      break;
    }
    for (i = 0; i < h; i++) {
      for (j = 0; j < w; j++) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int h, w, i, j;
  for (;;) {
    cin >> h >> w;
    for (i = 0; i < h; i++) {
      for (j = 0; j < w; j++) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

int main() {
  int h, w;
  for (;;) {
    std::cin >> h >> w;
    if (h == 0 && w == 0)
      break;
    for (int i = 0; i != h; ++i) {
      for (int j = 0; j != w; ++j) {
        std::cout << '#';
      }
      std::cout << '\\n';
    }
    std::cout << '\\n';
  }
}

Error: TLE

Fixed submission:

#include <iostream>

int main() {
  int h, w;
  for (;;) {
    std::cin >> h >> w;
    if (h == w == 0)
      break;
    for (int i = 0; i != h; ++i) {
      for (int j = 0; j != w; ++j) {
        std::cout << '#';
      }
      std::cout << '\\n';
    }
  }
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

int main(int argc, char const *argv[]) {
  int h, w;
  std::cin >> h >> w;
  while (!(h == 0 && h == w)) {
    for (int i = 0; i < h; i++) {
      for (int i = 0; i < w; i++) {
        std::cout << "#";
      }
      std::cout << std::endl;
    }
    std::cout << std::endl;
    std::cin >> h >> w;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

int main(int argc, char const *argv[]) {
  int h, w;
  std::cin >> h >> w;
  while (!(h == 0 && h == w)) {
    for (int i = 0; i < h; i++) {
      for (int i = 0; i < w; i++) {
        std::cout << "#";
      }
      std::cout << std::endl;
    }
  }

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

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

int main() {
  int H, W;
  int a, b;
  while (true) {
    cin >> H >> W;
    if (H == 0 && W == 0)
      break;
    for (a = 0; a < H; a = a + 1) {
      for (b = 0; b < W; b = b + 1) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
  }
}

Error: TLE

Fixed submission:

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

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

#include <iostream>
using namespace std;
int main() {
  int H, W;
  cin >> H >> W;
  while (W > 0 && H > 0) {
    for (int i = 1; i <= H; i++) {
      for (int j = 1; j <= W; j++) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
    cin >> H >> W;
  }

  return 0;
}


Error: TLE

Fixed submission:

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

#include <iostream>

using namespace std;

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

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w, i, j;

  while (1) {
    cin >> h >> w;
    if (h == 0 && w == 0)
      break;
    for (j = 1; j <= h; j++) {
      for (i = 1; i <= w; i++) {
        cout << '#';
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w, i, j;
  cin >> h >> w;
  while (1) {
    if (h == 0 && w == 0)
      break;
    for (j = 1; j <= h; j++) {
      for (i = 1; i <= w; i++) {
        cout << "#";
      }
      cout << endl;
    }
  }
  return 0;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

int main() {
  int H, W;

  while (1) {
    std::cin >> H >> W;
    if (H == 0 && W == 0) {
      break;
    }
    for (int i = 0; i < H; i++) {
      for (int n = 0; n < W; n++) {
        std::cout << "#";
      }
      std::cout << std::endl;
    }
    std::cout << std::endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

int main() {
  int H, W, i = 0, n = 0;

  for (std::cin >> H >> W; H != 0 && W != 0;) {
    while (n <= H) {
      while (i <= W) {
        if (i < W) {
          std::cout << "#";
          i++;
        } else if (i == W) {
          std::cout << "#" << std::endl;
        }
        n++;
      }
    }
    std::cout << " " << std::endl;
  }

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

#include <stdio.h>

int main(void) {
  int H, W, 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: -11

Fixed submission:

#include <stdio.h>

int main(void) {
  int H, W, i, j;
  while (1) {
    scanf("%d %d\\n", 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;
}
Problem p02403 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>

int main() {
  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");
  }
}


Error: TLE

Fixed submission:

#include <cstdio>

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

#include <cstdio>
#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 << endl;
    }
    cout << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <cstdio>
#include <iostream>

using namespace std;

int main() {

  int H, W;

  while (1) {
    cin >> H >> W;
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        cout << "#";
      }
      cout << endl;
    }
  }

  return 0;
}