Submission #2354969
Source Code Expand
def solve(N, A):
c = int(N / 2)
left = sorted(A)[c - 1]
right = sorted(A)[c]
if left == right:
for x in range(N):
print(left)
return;
for x in range(N):
if A[x] <= left:
print(right)
if A[x] >= right:
print(left)
if __name__ == "__main__":
N = int(input())
A = list(map(lambda x: int(x), input().split()))
solve(N, A)
Submission Info
| Submission Time | |
|---|---|
| Task | C - Many Medians |
| User | rerost |
| Language | Python (3.4.3) |
| Score | 300 |
| Code Size | 449 Byte |
| Status | AC |
| Exec Time | 387 ms |
| Memory | 26772 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample1.txt, sample2.txt, sample3.txt |
| All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 11.txt, 12.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 1.txt | AC | 17 ms | 3060 KiB |
| 10.txt | AC | 366 ms | 24604 KiB |
| 11.txt | AC | 239 ms | 24924 KiB |
| 12.txt | AC | 177 ms | 19076 KiB |
| 2.txt | AC | 187 ms | 13672 KiB |
| 3.txt | AC | 383 ms | 25228 KiB |
| 4.txt | AC | 362 ms | 24036 KiB |
| 5.txt | AC | 387 ms | 26772 KiB |
| 6.txt | AC | 365 ms | 24848 KiB |
| 7.txt | AC | 304 ms | 19444 KiB |
| 8.txt | AC | 369 ms | 23828 KiB |
| 9.txt | AC | 385 ms | 25744 KiB |
| sample1.txt | AC | 18 ms | 3060 KiB |
| sample2.txt | AC | 17 ms | 3060 KiB |
| sample3.txt | AC | 17 ms | 2940 KiB |