minimal-mistakes icon indicating copy to clipboard operation
minimal-mistakes copied to clipboard

Update _config.yml

Open BlackHan26 opened this issue 1 year ago • 0 comments

오늘 배운것을 모두 써보기

  1. 먼저 리스트를 만들어본다
  2. 이렇게 쉽게 해결

링크도 활용하기

Click here


마지막으로 테이블 작성하기

1번 항목 2번항목
cell1 cell2
ccell3 cell4

코팅 넣어보기

import sys
from collections import Counter
input=sys.stdin.readline

N=int(input())
word=list(map(int,input().split()))
answer=[-1]*N
stk=[]
counter=Counter(word)

for i in range(N):
    while stk and counter[word[stk[-1]]]<counter[word[i]]:
        answer[stk.pop()]=word[i]
    stk.append(i)
print(*answer)

BlackHan26 avatar Mar 24 '23 11:03 BlackHan26