Submission #164478

# Submission time Handle Problem Language Result Execution time Memory
164478 2019-11-21T03:19:32 Z oolimry Carnival (CEOI14_carnival) C++14
0 / 100
8 ms 380 KB
#include <bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> unique;
	int answer[n+1];
	for(int i = 1;i <= n;i++){
		cout << unique.size() + 1 << " ";
		for(int x : unique) cout << x << " ";
		cout << i << " ";
		cout << endl;
		
		int no;
		cin >> no;
		if(no == unique.size()){
			int low = -1;
			int high = unique.size();
			while(true){
				if(low == high - 1) break;
				int s = (low + high) / 2;
				cout << s + 2 << " ";
				for(int j = 0;j <= s;j++){
					cout << unique[j] << " ";
				}
				cout << i << " ";
				cout << endl;
				
				int no;
				cin >> no;
				if(no == s + 1){
					high = s; ///overlap
				}
				else{
					low = s; ///i is diff from 0...s
				}
			}
			answer[i] = high;
		}
		else{
			answer[i] = unique.size();
			unique.push_back(i);
		}
	}
	cout << "0 ";
	for(int i = 1;i <= n;i++){
		cout << answer[i] << " ";
	}
	return 0;
}

Compilation message

carnival.cpp: In function 'int main()':
carnival.cpp:18:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(no == unique.size()){
      ~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 376 KB Integer 0 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 248 KB Integer 0 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 380 KB Integer 0 violates the range [1, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 376 KB Integer 0 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 376 KB Integer 0 violates the range [1, 2]
2 Halted 0 ms 0 KB -