- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
#include <iostream>
#include <map>
using namespace std;
int B[105], N, k, u, v, i, z;
map<int, int> A;
main()
{
for(cin >> N; cin >> k;)
{
A[k]++, B[i++] = k;
A[k] > v ?
v = A[k], u = k :
A[k] ^ v ?
0 : u = min(u, k);
}
for(; z < N; z++)
if(B[z] ^ u)
cout << B[z] << " ";
while(v--) cout << u << " ";
}
1024-- 23.10.2016 07:00 # −1
guestinho 23.10.2016 19:56 # −1
1024-- 23.10.2016 20:33 # 0
1024-- 23.10.2016 20:34 # 0