forked from CBNU-Nnet/2022-algorithm-study
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3주차] : 김예경 - 5883 아이폰 9S Silver4 (CBNU-Nnet#60)
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
n=int(input()) | ||
a=list() | ||
for _ in range(n): | ||
a.append(int(input())) | ||
a_set = set(a) | ||
|
||
res=0 | ||
for x in a_set: | ||
cnt=1 | ||
prev=a[0] | ||
for i in range(1,n): | ||
if x==a[i]: | ||
continue | ||
if prev==a[i]: | ||
cnt+=1 | ||
else: | ||
prev=a[i] | ||
cnt=1 | ||
|
||
if cnt>res: | ||
res=cnt | ||
|
||
print(res) |