ドラゴンのパズル

入力

H W N M
d11 d12 d13 ...
d21 d22 d23 ...
d31 d32 d33 ...
...

出力

x1 x2
d11 d12 d13 d14 ...
x2 y2
d21 d22 d23 d24 ...
...

スコア

テストケース

サンプルコード

以下は、この問題に対して不正でない出力を行うC++のサンプルコードである。

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

int **drops;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int H, W, N, M;
	cin >> H >> W >> N >> M;

	drops = (int **)malloc(sizeof(int *) * H);
	for (int y = 0; y < H; y++) {
		drops[y] = (int *)malloc(sizeof(int) * W);
		for (int x = 0; x < W; x++) {
			cin >> drops[y][x];
		}
	}

	for (int i = 0; i < N; i++) {
		cout << 2 << " " << 2 << endl;

		for (int j = 0; j < M; j++) {
			cout << (j % 4) + 1;
			if (j == M - 1) {
				cout << endl;
			} else {
				cout << " ";
			}
		}
	}

	return 0;
}

入力例

5 5 1 3
1 2 3 4 5
1 2 3 4 5
1 2 3 3 4
1 2 5 4 5
1 2 3 4 5

出力例

3 4
1 2 2

Submit Code

0 bytes