1964 2022. 12. 12 14:16:49 12Boti Nomekop python3 Időlimit túllépés 60/100 5.066s 15404 KiB
read = True
if read:
  N = int(input())
  P = [int(x) for x in input().split()]
else:
  N = 5
  P = [3, 2, 3, 1, 5]
P.sort()


def ask(t):
  if read:
    print('?', *t)
    return int(input())
  else:
    c = [4, 4, 1, 1, 2]
    s = 0
    for a, b in zip(t, c):
      s += a * b
    return s


base1 = ask(P)
P[0], P[-1] = P[-1], P[0]
base2 = ask(P)
P[0], P[-1] = P[-1], P[0]

D = [0]*N
for i in range(1, N):
  if P[0] == P[i]:
    P[0], P[-1] = P[-1], P[0]
    used = base2
  else:
    used = base1
  P[0], P[i] = P[i], P[0]
  new = ask(P)
  P[0], P[i] = P[i], P[0]
  # (P0A0 + PiAi) - (P0Ai + PiA0)
  # = A0(P0-Pi) + Ai(Pi-P0)
  # = A0(P0-Pi) - Ai(P0-Pi)
  # = (A0-Ai)(P0-Pi)
  # = (Ai-A0)(Pi-P0)
  D[i] = (used - new) // (P[i] - P[0])
  if used == base2:
    P[0], P[-1] = P[-1], P[0]

I = [b for a,b in sorted(zip(D, range(N)))]
R = [None]*N
for p, i in zip(P, I):
  R[i] = p
print('!', *R)
Részfeladat Összpont Teszt Verdikt Idő Memória
subtask1 0/0
1 Elfogadva 18ms 11504 KiB
subtask2 10/10
2 Elfogadva 18ms 11924 KiB
3 Elfogadva 17ms 12196 KiB
subtask3 30/30
4 Elfogadva 23ms 12432 KiB
5 Elfogadva 107ms 12420 KiB
6 Elfogadva 105ms 12720 KiB
7 Elfogadva 105ms 12732 KiB
8 Elfogadva 21ms 12740 KiB
9 Elfogadva 108ms 13048 KiB
subtask4 20/20
10 Elfogadva 351ms 13392 KiB
11 Elfogadva 363ms 13456 KiB
12 Elfogadva 356ms 13784 KiB
13 Elfogadva 358ms 13860 KiB
subtask5 0/40
14 Időlimit túllépés 5.046s 6204 KiB
15 Időlimit túllépés 5.066s 6236 KiB
16 Elfogadva 4.691s 15404 KiB
17 Elfogadva 4.083s 15116 KiB
18 Időlimit túllépés 5.013s 6424 KiB
19 Időlimit túllépés 5.026s 6368 KiB
20 Időlimit túllépés 5.021s 6636 KiB
21 Időlimit túllépés 5.028s 6412 KiB