Skip to content

Commit 93a0d86

Browse files
committed
[BOJ] 도키도키 간식드리미 / 실버3 / 28분
1 parent 90d65a3 commit 93a0d86

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
a = int(input())
2+
sts = list(map(int, input().split()))
3+
stack = []
4+
target = 1
5+
6+
for st in sts:
7+
stack.append(st)
8+
while stack and stack[-1] == target:
9+
stack.pop()
10+
target +=1
11+
12+
if stack:
13+
print('Sad')
14+
else:
15+
print('Nice')

0 commit comments

Comments
 (0)