結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-07-21 01:12:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 240 bytes |
| 記録 | |
| コンパイル時間 | 104 ms |
| コンパイル使用メモリ | 22,528 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 2.00 |
| 最終ジャッジ日時 | 2024-07-16 07:14:00 |
| 合計ジャッジ時間 | 3,207 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 30 |
コンパイルメッセージ
main.cpp: In function ‘int ask(int)’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &res);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <cstdio>
using namespace std;
int ask(int y){
printf("? %d\n", y);
fflush(stdout);
int res;
scanf("%d", &res);
return res;
}
int main(){
int t = ask(123);
printf("! 123\n");
fflush(stdout);
return 0;
}