結果

問題 No.934 Explosive energy drink
ユーザー taotao54321taotao54321
提出日時 2020-01-03 13:15:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 326 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 3,429 ms
コンパイル使用メモリ 201,116 KB
実行使用メモリ 24,408 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:22:35
合計ジャッジ時間 8,553 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
23,604 KB
testcase_01 AC 311 ms
24,408 KB
testcase_02 AC 23 ms
23,544 KB
testcase_03 AC 162 ms
24,276 KB
testcase_04 AC 311 ms
23,964 KB
testcase_05 AC 24 ms
23,616 KB
testcase_06 AC 23 ms
23,388 KB
testcase_07 AC 25 ms
24,348 KB
testcase_08 AC 24 ms
24,012 KB
testcase_09 AC 25 ms
24,348 KB
testcase_10 AC 26 ms
24,024 KB
testcase_11 AC 25 ms
23,748 KB
testcase_12 AC 26 ms
23,652 KB
testcase_13 AC 29 ms
23,628 KB
testcase_14 AC 30 ms
23,316 KB
testcase_15 AC 106 ms
23,340 KB
testcase_16 AC 41 ms
23,496 KB
testcase_17 AC 66 ms
23,976 KB
testcase_18 AC 67 ms
23,604 KB
testcase_19 AC 130 ms
24,348 KB
testcase_20 AC 207 ms
24,012 KB
testcase_21 AC 220 ms
23,964 KB
testcase_22 AC 326 ms
23,544 KB
testcase_23 AC 314 ms
23,964 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