Language: C++

#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;
 
int H, W, A, B;
int s[1001][1001];
 
void output() {
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cout << s[i][j];
    }
    cout << endl;
  }
}
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> H >> W >> A >> B;
 
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (j < A && i < B) {
        s[i][j] = 0;
      } else if (j >= A && i < B) {
        s[i][j] = 1;
      } else if (j < A && i >= B) {
        s[i][j] = 1;
      } else {
        s[i][j] = 0;
      }
    }
  }
 
  output();
  return 0;
}
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

int H, W, A, B;
int s[1001][1001];

void output() {
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cout << s[i][j];
    }
    cout << endl;
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> H >> W >> A >> B;

  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (j < A && i < B) {
        s[i][j] = 0;
      } else if (j >= A && i < B) {
        s[i][j] = 1;
      } else if (j < A && i >= B) {
        s[i][j] = 1;
      } else {
        s[i][j] = 0;
      }
    }
  }

  output();
  return 0;
}
Submission I

Compiler output:
a.cc:71:5: error: redefinition of 'int H'
   71 | int H, W, A, B;
      |     ^
a.cc:19:5: note: 'int H' previously declared here
   19 | int H, W, A, B;
      |     ^
a.cc:71:8: error: redefinition of 'int W'
   71 | int H, W, A, B;
      |        ^
a.cc:19:8: note: 'int W' previously declared here
   19 | int H, W, A, B;
      |        ^
a.cc:71:11: error: redefinition of 'int A'
   71 | int H, W, A, B;
      |           ^
a.cc:19:11: note: 'int A' previously declared here
   19 | int H, W, A, B;
      |           ^
a.cc:71:14: error: redefinition of 'int B'
   71 | int H, W, A, B;
      |              ^
a.cc:19:14: note: 'int B' previously declared here
   19 | int H, W, A, B;
      |              ^
a.cc:72:5: error: redefinition of 'int s [1001][1001]'
   72 | int s[1001][1001];
      |     ^
a.cc:20:5: note: 'int s [1001][1001]' previously declared here
   20 | int s[1001][1001];
      |     ^
a.cc:74:6: error: redefinition of 'void output()'
   74 | void output() {
      |      ^~~~~~
a.cc:22:6: note: 'void output()' previously defined here
   22 | void output() {
      |      ^~~~~~
a.cc:83:5: error: redefinition of 'int main()'
   83 | int main() {
      |     ^~~~
a.cc:31:5: note: 'int main()' previously defined here
   31 | int main() {
      |     ^~~~
a.cc:105:1: error: 'Submission' does not name a type
  105 | Submission I
      | ^~~~~~~~~~