結果

問題 No.850 企業コンテスト2位
ユーザー 👑 hos.lyric
提出日時 2019-07-05 23:37:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 73,928 KB
実行使用メモリ 25,476 KB
平均クエリ数 236.00
最終ジャッジ日時 2024-07-16 17:37:13
合計ジャッジ時間 4,237 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21 WA * 6
権限があれば一括ダウンロードができます

ソースコード

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