結果
| 問題 | No.166 マス埋めゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-18 21:48:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 33,536 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-04 16:24:35 |
| 合計ジャッジ時間 | 2,342 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:15: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | fscanf(stdin, "%d %d %d %d", &H, &W, &N, &K);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <vector>
using namespace std;
int main(){
using std::vector;
int H, W, N, K;
int i;
int cnt = 0;
int size;
fscanf(stdin, "%d %d %d %d", &H, &W, &N, &K);
size = H * W;
//vector<vector<int>> arr(H, vector<int>(W));
for (i = 1; i <= N; i++) {
cnt++;
if (cnt >= size) {
break;
}
if (i == N) {
i = 0; // for next roop
}
}
if (i == K) {
printf("YES\n");
}
else {
printf("NO\n");
}
return 0;
}