Submission #7644695


Source Code Expand

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

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

//! 1の数
ll P[1005];
ll M[1005][1005];

int main()
{
    ll H, W, A, B;
    cin >> H >> W >> A >> B;

    memset(M, 0, sizeof(M));
    REP(i, H)
    {
        //! 1の数
        ll n = 0;
        REP(j, W)
        {
            if (P[j] < B)
            {
                M[i][j] = 1;
                n++;
                P[j]++;
            }
        }

        if (std::min(n, W - n) != A)
        {
            cout << "No" << endl;
            return 0;
        }
    }

    REP(i, H)
    {
        REP(j, W)
        {
            cout << M[i][j];
        }
        cout << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task A - 01 Matrix
User coco18000
Language C++14 (GCC 5.4.1)
Score 0
Code Size 941 Byte
Status WA
Exec Time 51 ms
Memory 9088 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
WA × 2
AC × 5
WA × 9
Set Name Test Cases
Sample sample-01.txt, sample-02.txt
All 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-01.txt AC 4 ms 8192 KB
01-02.txt WA 4 ms 8192 KB
01-03.txt WA 4 ms 8192 KB
01-04.txt AC 5 ms 8192 KB
01-05.txt WA 4 ms 8192 KB
01-06.txt WA 4 ms 8192 KB
01-07.txt AC 5 ms 8192 KB
01-08.txt WA 4 ms 8192 KB
01-09.txt WA 4 ms 8192 KB
01-10.txt AC 51 ms 9088 KB
01-11.txt WA 4 ms 8192 KB
01-12.txt AC 51 ms 9088 KB
sample-01.txt WA 4 ms 8192 KB
sample-02.txt WA 4 ms 8192 KB