結果
| 問題 | No.3084 Identify f(x) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-09-09 09:25:54 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 22 ms / 2,000 ms | 
| コード長 | 251 bytes | 
| コンパイル時間 | 2,788 ms | 
| コンパイル使用メモリ | 274,928 KB | 
| 実行使用メモリ | 26,240 KB | 
| 平均クエリ数 | 3.00 | 
| 最終ジャッジ日時 | 2025-09-09 09:25:58 | 
| 合計ジャッジ時間 | 4,131 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 7 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     scanf("%d", &a);
      |     ~~~~~^~~~~~~~~~
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |     scanf("%d", &b);
      |     ~~~~~^~~~~~~~~~
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
    printf("? 1\n");
    fflush(stdout);
    int a;
    scanf("%d", &a);
    printf("? -1\n");
    fflush(stdout);
    int b;
    scanf("%d", &b);
    printf("! %d %d\n", (a-b)/2, (a+b)/2);
}
            
            
            
        