結果
| 問題 |
No.166 マス埋めゲーム
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-06 14:44:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 372 bytes |
| コンパイル時間 | 621 ms |
| コンパイル使用メモリ | 27,648 KB |
| 実行使用メモリ | 17,216 KB |
| 最終ジャッジ日時 | 2025-03-06 14:45:00 |
| 合計ジャッジ時間 | 2,997 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 4 WA * 1 TLE * 1 -- * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:21: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
17 | char *ans = "NO";
| ^~~~
main.cpp:21:31: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
21 | ans = "YES";
| ^~~~~
main.cpp:23:31: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
23 | ans = "NO";
| ^~~~
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&ver);
| ~~~~~^~~~~~~~~~~
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d",&hor);
| ~~~~~^~~~~~~~~~~
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&num);
| ~~~~~^~~~~~~~~~~
main.cpp:15:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%d",&k);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
// 縦マス
int ver = 0;
scanf("%d",&ver);
// 横マス
int hor = 0;
scanf("%d",&hor);
// 人数
int num = 0;
scanf("%d",&num);
// K番目
int k = 0;
scanf("%d",&k);
char *ans = "NO";
int i = 1;
while(i != (ver * hor) + 1){
if(i % num == k){
ans = "YES";
}else{
ans = "NO";
}
i++;
}
printf("%s",ans);
}
sasa