Language: C++

#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
using ll = long long;
int MOD = 1e9 + 7;
using namespace std;
ll GCD(ll x, ll y)
{
    if (y == 0)
    {
        return x;
    }
    else
    {
        return GCD(y, x % y);
    }
}
ll LCM(ll x, ll y)
{
    return x / GCD(x, y) * y;
}
struct UnionFind
{
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++)
            par[i] = i;
    }

    int root(int x)
    { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x)
            return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y)
    {                     // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry)
            return;   //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
int main()
{
    /*int h, w;
    cin >> h >> w;
    int a, b;
    cin >> a >> b;
    
    if (h == 1 || w == 1)
    {
        if (h == 1)
        {
            if (b != 0||a>w/2)
            {
                cout << "No" << endl;
                
            }
            else
            {
                for (int i = 0; i < a; i++)
                {
                    cout << 1;
                }
                for (int i = a; i < w; i++)
                {
                    cout << 0;
                    
                }
                cout << endl;
            }
        }
        else
        {
            if (a != 0||b>h/2)
            {
                cout << "No" << endl;
                
            }
            else
            {
                for (int i = 0; i < b; i++)
                {
                    cout << 1 << endl;
                }
                for (int i = b; i < h; i++)
                {
                    cout << 0 << endl;
                }
                // cout<<endl;
            }
            
        }
        return 0;
    }
    if (h / 2 < a || w / 2 < b)
    {
        cout << "No" << endl;
       // cout<<"jklsdf"<<endl;
        return 0;
    }
    if (a * h != b * w)
    {
        cout << "No" << endl;
        return 0;
    }*/
    vector<int> H(h, a);
    vector<int> W(w, b);
    vector<vector<int>> reg(h, vector<int>(w));
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (H[i] > 0 && W[j] > 0)
            {
                reg[i][j] = 1;
                H[i]--;
                W[j]--;
            }
        }
    }
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            cout << reg[i][j];
        }
        cout << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:126:19: error: 'h' was not declared in this scope
  126 |     vector<int> H(h, a);
      |                   ^
a.cc:126:22: error: 'a' was not declared in this scope
  126 |     vector<int> H(h, a);
      |                      ^
a.cc:127:19: error: 'w' was not declared in this scope
  127 |     vector<int> W(w, b);
      |                   ^
a.cc:127:22: error: 'b' was not declared in this scope
  127 |     vector<int> W(w, b);
      |                      ^