結果

問題 No.934 Explosive energy drink
ユーザー aajisakaaajisaka
提出日時 2019-12-15 02:54:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,757 bytes
コンパイル時間 3,478 ms
コンパイル使用メモリ 171,208 KB
実行使用メモリ 24,444 KB
平均クエリ数 225.08
最終ジャッジ日時 2023-09-23 19:17:43
合計ジャッジ時間 8,515 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
24,324 KB
testcase_01 AC 181 ms
24,372 KB
testcase_02 AC 27 ms
23,556 KB
testcase_03 AC 102 ms
23,820 KB
testcase_04 AC 299 ms
23,412 KB
testcase_05 AC 27 ms
24,264 KB
testcase_06 AC 25 ms
23,412 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 25 ms
24,048 KB
testcase_10 AC 23 ms
24,048 KB
testcase_11 AC 28 ms
24,060 KB
testcase_12 AC 25 ms
23,700 KB
testcase_13 AC 28 ms
24,060 KB
testcase_14 AC 30 ms
23,436 KB
testcase_15 AC 101 ms
24,444 KB
testcase_16 AC 38 ms
24,384 KB
testcase_17 AC 51 ms
23,568 KB
testcase_18 AC 53 ms
24,396 KB
testcase_19 AC 80 ms
24,276 KB
testcase_20 AC 131 ms
24,048 KB
testcase_21 AC 128 ms
23,412 KB
testcase_22 AC 172 ms
23,580 KB
testcase_23 AC 175 ms
24,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using P = pair<ll, ll>;

constexpr double PI = 3.14159265358979323846;
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

class ExplosiveEnergyDrink {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      int n; cin >> n;
      set<int> st;
      for(int i=1; i<=n; i++) {
        st.insert(i);
      }
      for(int i=1; i<=n; i++) {
        st.erase(i);
        if (st.size() == 2) break;
        cout << "? " << st.size() << endl;
        for(auto e: st) {
          cout << e << ' ';
        }
        cout << endl;
        int ans; cin >> ans;
        if (ans==0) {
          st.insert(i);
        }
      }

      cout << "! " << st.size() << endl;
      for(auto e: st) {
        cout << e << ' ';
      }
      cout << endl;
    }
};

signed main() {
  ExplosiveEnergyDrink solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
0