답안 #103821

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
103821 2019-04-02T20:09:30 Z Shtef Zagonetka (COI18_zagonetka) C++14
9 / 100
3000 ms 416 KB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

vector <int> a, mini, maxi;
int n;

void pitaj(){
	cout << "query ";
	for(int i = 0 ; i < n ; ++i){
		cout << a[i];
		if(i < n - 1){
			cout << " ";
		}
	}
	cout << endl;
	cout.flush();
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for(int i = 0 ; i < n ; ++i){
	int x;
	cin >> x;
	a.push_back(i + 1);
}
cout.flush();
do{
	pitaj();
	bool p;
	cin >> p;
	cout.flush();
	if(p){
		maxi = a;
		if(mini.empty()){
			mini = a;
		}
	}
}while(next_permutation(a.begin(), a.end()));
cout << "end" << endl;
cout.flush();
for(int i = 0 ; i < n ; ++i){
	cout << mini[i] << ' ';
}
cout << endl;
for(int i = 0 ; i < n ; ++i){
	cout << maxi[i] << ' ';
}
cout << endl;

return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 416 KB Output is correct
2 Correct 4 ms 256 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 3 ms 412 KB Output is correct
5 Correct 8 ms 256 KB Output is correct
6 Correct 8 ms 256 KB Output is correct
7 Correct 4 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3015 ms 256 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3041 ms 256 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3094 ms 256 KB Time limit exceeded
2 Halted 0 ms 0 KB -