Submission #298313

# Submission time Handle Problem Language Result Execution time Memory
298313 2020-09-12T17:17:24 Z FlashGamezzz Carnival (CEOI14_carnival) C++17
0 / 100
3 ms 648 KB
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, count = 2, prefs[150], vals[150];
	cin >> n;
	prefs[0] = 1;
	string s = "1";
	for (int i = 1; i < n; i++) {
		s += " " + to_string(i+1);
		cout << i+1 << " " << s << endl;
		cin >> prefs[i];
	}
	vals[0] = 1;
	for (int i = 1; i < n; i++) {
		if (prefs[i] == prefs[i-1]+1) {
			vals[i] = count;
			count++;
		}
	}
	vector<int> nums;
	for (int i = 0; i < n; i++) {
		if (vals[i] == 0) {
			vector<int> temp;
			for (int a : nums){
				temp.push_back(a);
			}
			while (temp.size() > 1) {
				int ind = rand() % nums.size(), v = temp[ind], in;
				cout << 2 << " " << v << " " << (i+1) << endl;
				cin >> in;
				if (in == 1) {
					vals[i] = v;
					break;
				}
				temp.erase(temp.begin() + ind);
			}
			if (vals[i] == 0) {
				vals[i] = temp[0];
			}
		} else {
			nums.push_back(vals[i]);
		}
	}
	cout << 0;
	for (int i = 0; i < n; i++) {
		cout << " " << vals[i];
	}
	cout << endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 648 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -