Rating changes for last rounds are temporarily rolled back. They will be returned soon.
×
# |
Author |
Problem |
Lang |
Verdict |
Time |
Memory |
Sent |
Judged |
|
53560113 |
Practice:
mnbvmar |
1150C
- 31
|
Python 3
|
Accepted
|
436 ms
|
3176 KB
|
2019-04-30 11:58:21 |
2019-04-30 11:58:21 |
|
N = int(input())
num_ones = input().count('1')
num_twos = N - num_ones
if not num_ones or not num_twos:
solution = [1] * num_ones + [2] * num_twos
else:
solution = [2, 1] + [2] * (num_twos - 1) + [1] * (num_ones - 1)
print(*solution)
Click to see test details