結果

問題 No.850 企業コンテスト2位
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-07-05 23:37:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 72,740 KB
実行使用メモリ 24,336 KB
平均クエリ数 236.00
最終ジャッジ日時 2023-09-23 17:43:37
合計ジャッジ時間 3,916 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,892 KB
testcase_01 AC 25 ms
23,628 KB
testcase_02 AC 22 ms
23,328 KB
testcase_03 AC 23 ms
23,976 KB
testcase_04 AC 22 ms
23,628 KB
testcase_05 AC 25 ms
24,264 KB
testcase_06 AC 25 ms
23,352 KB
testcase_07 AC 26 ms
23,352 KB
testcase_08 AC 28 ms
23,820 KB
testcase_09 AC 28 ms
23,496 KB
testcase_10 AC 32 ms
24,204 KB
testcase_11 AC 32 ms
23,760 KB
testcase_12 AC 33 ms
24,096 KB
testcase_13 AC 32 ms
24,132 KB
testcase_14 AC 33 ms
23,904 KB
testcase_15 AC 31 ms
23,892 KB
testcase_16 AC 31 ms
23,328 KB
testcase_17 AC 31 ms
23,328 KB
testcase_18 AC 30 ms
23,892 KB
testcase_19 AC 32 ms
23,376 KB
testcase_20 WA -
testcase_21 AC 33 ms
23,556 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 22 ms
23,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  iota(a.begin(), a.end(), 1);
  partial_sort(a.begin(), a.begin() + 2, a.end(), [](const int a, const int b) {
    cout << "? " << a << " " << b << endl;
    int res;
    cin >> res;
    return (res == a);
  });
  cout << "! " << a[1] << endl;
  return 0;
}
0