結果

問題 No.514 宝探し3
ユーザー Konton7Konton7
提出日時 2020-02-05 15:30:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 732 bytes
コンパイル時間 1,736 ms
コンパイル使用メモリ 163,264 KB
実行使用メモリ 24,336 KB
平均クエリ数 2.00
最終ジャッジ日時 2023-09-23 19:37:10
合計ジャッジ時間 5,306 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:35:16: 警告: ‘x’ may be used uninitialized [-Wmaybe-uninitialized]
   35 |     y = (a + b - x) / 2;
      |         ~~~~~~~^~~~
main.cpp:21:18: 備考: ‘x’ はここで定義されています
   21 |     int a, b, d, x, y;
      |                  ^

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using PII = std::pair<int, int>;
using PLL = std::pair<ll, ll>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define DEBUG

int main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int a, b, d, x, y;
    
    cout << 0 << " " << 0 << endl;
    cin>>d;
    if(d==0)
        return 0;
    a = d;
    
    cout << 1000000000 << " " << 0 << endl;
    cin>>d;
    if(d==0)
        return 0;
    b = d;
    
    y = (a + b - x) / 2;
    x = a - y;

    cout << x << " " << y << endl;


    return 0;
}
0