from sys import stdin, stdout
n:int=int(stdin.readline())
powers=stdin.readline().split()
powers = [int(i) for i in powers]
def test_setup(p_in:list[int]) ->int:
stdout.write("? "+" ".join(map(str, p_in)))
stdout.flush()
return int(stdin.readline())
a=powers[0]
b=powers[1]
diffs:list[int]=[0]
l=test_setup(powers)
for i in range(1,n):
#SWAP
b=powers[i]
new_setup=powers.copy()
new_setup[0],new_setup[i]=powers[i],powers[0]
k=test_setup(new_setup)
diffs.append((l-k)/(a-b))
powers_sorted:list[int]=powers.copy()
powers_sorted.sort()
final_setup:list[int]=[]
print(diffs)
for i in range(len(diffs.copy())):
loc_found:int
szelsoertek:int=-1000000000000000000000000000
for j in range(len(diffs)):
if diffs[j]>szelsoertek:
loc_found=j
szelsoertek=diffs[j]
#print("temp found "+str(diffs[j]))
#print("found "+str(diffs[loc_found]))
diffs.pop(loc_found)
final_setup.append(powers_sorted.pop(loc_found))
#WRITE FINAL
stdout.write("! "+" ".join(map(str, final_setup)))
stdout.flush()
exit(0)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Time limit exceeded | 16ms | 3704 KiB | ||||
subtask2 | 0/10 | ||||||
2 | Time limit exceeded | 16ms | 3968 KiB | ||||
3 | Time limit exceeded | 16ms | 4200 KiB | ||||
subtask3 | 0/30 | ||||||
4 | Time limit exceeded | 16ms | 4480 KiB | ||||
5 | Time limit exceeded | 16ms | 4760 KiB | ||||
6 | Time limit exceeded | 16ms | 4776 KiB | ||||
7 | Time limit exceeded | 16ms | 4996 KiB | ||||
8 | Time limit exceeded | 16ms | 5144 KiB | ||||
9 | Time limit exceeded | 16ms | 5488 KiB | ||||
subtask4 | 0/20 | ||||||
10 | Time limit exceeded | 16ms | 5384 KiB | ||||
11 | Time limit exceeded | 16ms | 5592 KiB | ||||
12 | Time limit exceeded | 16ms | 5784 KiB | ||||
13 | Time limit exceeded | 16ms | 6020 KiB | ||||
subtask5 | 0/40 | ||||||
14 | Time limit exceeded | 17ms | 6588 KiB | ||||
15 | Time limit exceeded | 17ms | 6684 KiB | ||||
16 | Time limit exceeded | 17ms | 6808 KiB | ||||
17 | Time limit exceeded | 17ms | 6724 KiB | ||||
18 | Time limit exceeded | 17ms | 6892 KiB | ||||
19 | Time limit exceeded | 17ms | 7180 KiB | ||||
20 | Time limit exceeded | 17ms | 7136 KiB | ||||
21 | Time limit exceeded | 17ms | 6988 KiB |