#44415: python AC(小心要去掉字串的括號)


suyueh (suyueh)

學校 : 不指定學校
編號 : 272111
來源 : [101.10.93.239]
最後登入時間 :
2024-12-10 22:48:32
k467. 分班 (Class) -- TOI練習賽202304新手組第2題 | From: [111.242.3.80] | 發表日期 : 2024-12-03 19:11

t=int(input())
l=input().split()
m=input().split()
lc=[]
lm=[]
for i in range(t):
  if int(l[i])>int(m[i]):
    lc.append(i+1)
  elif int(l[i])<int(m[i]):
    lm.append(i+1)
x=' '.join(str(z) for z in lc)
y=' '.join(str(z) for z in lm)
if len(lc)==0 and len(lm)==0:
  print(-1)
  print(-1)
elif len(lc)==0 and len(lm)!=0:
  print(-1)
  print(y)
elif len(lc)!=0 and len(lm)==0:
  print(x)
  print(-1)
else:
  print(x)
  print(y)
 
ZeroJudge Forum