結果

問題 No.166 マス埋めゲーム
コンテスト
ユーザー ZackeyKei
提出日時 2015-03-19 23:37:06
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 432 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 134 ms
コンパイル使用メモリ 40,848 KB
実行使用メモリ 1,048,576 KB
最終ジャッジ日時 2026-03-18 06:10:39
合計ジャッジ時間 1,332 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 WA * 3 RE * 1 MLE * 2 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>

int main(void)
{
	int h, w, n, k;
	int no = 0;

	scanf("%d%d%d%d", &h, &w, &n, &k);
	
	int **math = new int*[h];
	for (int i = 0; i < h; i++)
	{
		math[i] = new int[w];
	}

	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			no++;
			math[i][j] = no;
			if (no == n)
			{
				no = 1;
			}
		}
	}

	if (math[h - 1][w - 1] == k)
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}

	return 0;
} 
0