CodeMan
Home
Uva
AtCoder
Codechef
Codeforce
Hackerrank
LeetCode
Devskill
TopCoder
Spoj
Algorithm
Python3
Hackerearth
Uri
C++
Data Structure
Monday, September 16, 2019
Codeforce A. Yaroslav and Permutations
#include
< iostream >
using
namespace
std
;
int
main
()
{
int
n
,
x
;
cin
>>
n
;
int
ar
[
10001
]
=
{
0
};
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
cin
>>
x
;
ar
[
x
]++;
if
(
ar
[
x
]
>
(
n
+
1
)/
2
)
return
cout
<<
"NO\n"
,
0
;
}
cout
<<
"YES\n"
;
return
0
;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment