답안 #967284

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
967284 2024-04-21T17:30:45 Z mdobric Zagonetka (COI18_zagonetka) C++11
0 / 100
0 ms 440 KB
#include <bits/stdc++.h>
using namespace std;

int n, p[105];
int a[10];
vector <int> ans1, ans2;

int main (void){
	
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> p[i];
		a[i] = i + 1;
	}
	if (n <= 6){
		do{
			cout << "? ";
			for (int i = 0; i < n; i++){
				cout << a[i] << " ";
			}
			cout << endl;
			cout.flush();
			int ans;
			cin >> ans;
			if (ans == 1){
				if (ans1.size() == 0){
					for (int i = 0; i < n; i++){
						ans1.push_back(a[i]); 
					}
				}
				ans2.clear();
				for (int i = 0; i < n; i++){
					ans2.push_back(a[i]); 
				}
			}
		}while(next_permutation(a, a + n));
		cout << "end" << endl;
		for (int i = 0; i < n; i++){
			cout << ans1[i] << " ";
		}
		cout << endl;
		cout.flush();
		for (int i = 0; i < n; i++){
			cout << ans2[i] << " ";
		}
		cout << endl;
		cout.flush();
	}
	
	
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 440 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -