結果
| 問題 | No.166 マス埋めゲーム |
| コンテスト | |
| ユーザー |
ZackeyKei
|
| 提出日時 | 2015-03-20 00:03:19 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 512 bytes |
| 記録 | |
| コンパイル時間 | 267 ms |
| コンパイル使用メモリ | 40,624 KB |
| 実行使用メモリ | 1,048,576 KB |
| 最終ジャッジ日時 | 2026-03-18 06:31:50 |
| 合計ジャッジ時間 | 1,659 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 RE * 1 MLE * 2 -- * 11 |
ソースコード
#include <cstdio>
int main(void)
{
int h, w, n, k;
int no = 0;
scanf("%d%d%d%d", &h, &w, &n, &k);
if (n == k)
{
if (h * w % n == 0)
{
printf("YES\n");
return 0;
}
}
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 = 0;
}
}
}
if (math[h - 1][w - 1] == k)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
return 0;
}
ZackeyKei