結果
問題 | No.166 マス埋めゲーム |
ユーザー |
![]() |
提出日時 | 2015-03-19 23:35:04 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 23,552 KB |
実行使用メモリ | 547,764 KB |
最終ジャッジ日時 | 2024-06-28 23:20:46 |
合計ジャッジ時間 | 1,827 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 3 WA * 3 RE * 1 MLE * 1 -- * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d%d%d%d", &h, &w, &n, &k); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio> int main(void) { int h, w, n, k; int no = 1; 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++) { math[i][j] = no; if (no == n) { no = 1; } no++; } } if (math[h - 1][w - 1] == k) { printf("YES\n"); } else { printf("NO\n"); } return 0; }