QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#61081#3675. Interactive Array Guessingabdelrahman001#WA 5ms5700kbC++201.2kb2022-11-09 20:12:332022-11-09 20:12:36

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-09 20:12:36]
  • Judged
  • Verdict: WA
  • Time: 5ms
  • Memory: 5700kb
  • [2022-11-09 20:12:33]
  • Submitted

answer

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e5 + 5;
int n;
vector<int> ans[N];
void ask(int l, int r) {
	cout << "? " << (r - l + 1) * 2;
	for(int i = l;i <= r;i++)
		cout << " " << i << " " << i;
	cout << endl;
	int k;
	cin >> k;
	vector<int> tmp;
	set<int> st;
	int cur = l;
	for(int i = 0;i < k;i++) {
		int x;
		cin >> x;
		if(st.count(x)) {
			ans[cur] = tmp;
			cur++;
			for(int j = 1;j < tmp.size();j++)
				cin >> x;
			i += tmp.size() - 1;
			st.clear();
			tmp.clear();
		} else {
			st.insert(x);
			tmp.push_back(x);
		}
	}
}
void answer() {
	cout << "!";
	for(int i = 1;i <= n;i++) {
		cout << " " << ans[i].size();
		for(auto j : ans[i])
			cout << " " << j;
	}
	cout << endl;
}
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n;
    if(n == 1) {
		ask(1, 1);
		answer();
		return 0;
	}
    ask(1, n / 2);
    ask(n / 2 + 1, n - (n & 1));
    if(n & 1)
		ask(n, n);
	answer();
    return 0;
}


详细

Test #1:

score: 100
Accepted
time: 5ms
memory: 5700kb

input:

3
2 1 1
4 1 2 1 2
4 2 1 2 1

output:

? 2 1 1
? 2 2 2
? 2 3 3
! 1 1 2 1 2 2 2 1

result:

ok 3 arrays, sum_len = 5

Test #2:

score: 0
Accepted
time: 5ms
memory: 5644kb

input:

3
4 2 3 2 3
2 2 2
6 1 4 2 1 4 2

output:

? 2 1 1
? 2 2 2
? 2 3 3
! 2 2 3 1 2 3 1 4 2

result:

ok 3 arrays, sum_len = 6

Test #3:

score: 0
Accepted
time: 0ms
memory: 5632kb

input:

3
4 1 2 1 2
4 1 2 1 2
4 2 1 2 1

output:

? 2 1 1
? 2 2 2
? 2 3 3
! 2 1 2 2 1 2 2 2 1

result:

ok 3 arrays, sum_len = 6

Test #4:

score: -100
Wrong Answer
time: 2ms
memory: 5644kb

input:

1

output:

? 2 1 1

result:

wrong answer asked 2 arrays, not in range [1..1]