結果

問題 No.934 Explosive energy drink
ユーザー eve__fuyukieve__fuyuki
提出日時 2019-12-29 15:26:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 337 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 201,096 KB
実行使用メモリ 24,396 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:21:40
合計ジャッジ時間 7,116 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,396 KB
testcase_01 AC 333 ms
23,688 KB
testcase_02 AC 26 ms
23,412 KB
testcase_03 AC 170 ms
24,216 KB
testcase_04 AC 335 ms
23,616 KB
testcase_05 AC 27 ms
24,012 KB
testcase_06 AC 26 ms
24,300 KB
testcase_07 AC 26 ms
23,664 KB
testcase_08 AC 27 ms
23,700 KB
testcase_09 AC 26 ms
23,400 KB
testcase_10 AC 27 ms
23,844 KB
testcase_11 AC 26 ms
23,856 KB
testcase_12 AC 29 ms
24,072 KB
testcase_13 AC 32 ms
23,556 KB
testcase_14 AC 35 ms
23,412 KB
testcase_15 AC 112 ms
23,412 KB
testcase_16 AC 47 ms
23,448 KB
testcase_17 AC 69 ms
23,412 KB
testcase_18 AC 69 ms
23,412 KB
testcase_19 AC 132 ms
24,228 KB
testcase_20 AC 221 ms
23,652 KB
testcase_21 AC 236 ms
24,360 KB
testcase_22 AC 331 ms
24,312 KB
testcase_23 AC 337 ms
23,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  int n;
  cin >> n;
  vector <int> ans;
  for (int i = 1; i <= n; i++) {
	  cout << "? " << n - 1 << endl;
	  for (int j = 1; j <= n; j++) {
		  if (i != j) {
			  cout << j;
			  if (j == n || (i == n && j == n - 1)) {
				  cout << endl;
				} else {
				  cout << " ";
				}
			}
		}
	  int a;
	  cin >> a;
	  if (!a) {
		  ans.push_back(i);
		}
	}
  cout << "! " << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
	  cout << ans[i];
	  if (i == ans.size() - 1) {
		  cout << endl;
		} else {
		  cout << " ";
		}
	}
  return 0;
}
0