Cod sursa(job #1229622)

Utilizator a_h1926Heidelbacher Andrei a_h1926 Data 17 septembrie 2014 20:25:09
Problema Boundingbox Scor Ascuns
Compilator cpp Status done
Runda Marime 0.93 kb
#include <cstdio>
#include <cstring>
#include <cassert>

using namespace std;

const char IN_FILE[] = "boundingbox.in";
const int MIN_TESTS = 1;
const int MAX_TESTS = 1000;
const int MIN_AREA = 1;
const int MAX_AREA = 50;

int main() {
    assert(freopen(IN_FILE, "r", stdin));
    int tests;
    assert(scanf("%d", &tests) == 1);
    assert(MIN_TESTS <= tests && tests <= MAX_TESTS);
    for (; tests > 0; --tests) {
        int rows, columns;
        assert(scanf("%d %d", &rows, &columns) == 2);
        assert(0 < rows && 0 < columns && rows * columns <= MAX_AREA);
        for (int x = 0; x < rows; ++x) {
            char row[MAX_AREA + 5];
            memset(row, 0, sizeof(row));
            assert(scanf("\n%s", row) == 1);
            assert(int(strlen(row)) == columns);
            for (int y = 0; y < columns; ++y)
                assert('0' <= row[y] && row[y] <= '1');
        }
    }
    return 0;
}