Submission #4050895
Source Code Expand
from itertools import accumulate N = int(input()) a_list = list(map(int, input().split())) a_list.sort() check = [False for _ in range(N)] acc = tuple(accumulate(a_list)) for i in range(N - 1): if acc[i] * 2 >= a_list[i + 1]: check[i] = True check[N - 1] = True ans = 0 for c in check: if c: ans += 1 else: ans = 0 print(ans)
Submission Info
Submission Time | |
---|---|
Task | B - Colorful Creatures |
User | ta7uw |
Language | Python (3.4.3) |
Score | 400 |
Code Size | 389 Byte |
Status | AC |
Exec Time | 127 ms |
Memory | 14428 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in12.txt, in13.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 124 ms | 14100 KB |
in10.txt | AC | 57 ms | 7428 KB |
in11.txt | AC | 125 ms | 14056 KB |
in12.txt | AC | 95 ms | 14148 KB |
in13.txt | AC | 92 ms | 14428 KB |
in2.txt | AC | 127 ms | 14352 KB |
in3.txt | AC | 126 ms | 14096 KB |
in4.txt | AC | 126 ms | 14100 KB |
in5.txt | AC | 56 ms | 7308 KB |
in6.txt | AC | 120 ms | 14148 KB |
in7.txt | AC | 124 ms | 14428 KB |
in8.txt | AC | 121 ms | 14016 KB |
in9.txt | AC | 30 ms | 4340 KB |
sample1.txt | AC | 18 ms | 3060 KB |
sample2.txt | AC | 18 ms | 3064 KB |
sample3.txt | AC | 18 ms | 3064 KB |