結果

問題 No.246 質問と回答
ユーザー kroton
提出日時 2015-07-21 01:10:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 236 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 22,272 KB
実行使用メモリ 43,304 KB
最終ジャッジ日時 2024-07-16 19:50:41
合計ジャッジ時間 6,624 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |     ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
using namespace std;

int ask(int y){
    printf("? %d", y);
    fflush(stdout);
    int res;
    scanf("%d", &res);
    return res;
}

int main(){
  int t = ask(123);
  printf("! 123");
  fflush(stdout);
  return 0;
}
0