Submission #1156754
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long llint; const int MAXN = 100100; llint arr[MAXN]; llint sum[MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, i; cin>>n; for (i = 0; i < n; ++i) cin>>arr[i]; sort(arr, arr + n); for (i = 0; i < n; ++i) sum[i + 1] = sum[i] + arr[i]; for (i = n - 1; arr[i] <= 2 * sum[i]; --i); cout<<n - i<<'\n'; }
Submission Info
Submission Time | |
---|---|
Task | B - Colorful Creatures |
User | viliml |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 450 Byte |
Status | AC |
Exec Time | 17 ms |
Memory | 1792 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 | 17 ms | 1792 KB |
in10.txt | AC | 7 ms | 896 KB |
in11.txt | AC | 16 ms | 1792 KB |
in12.txt | AC | 13 ms | 1792 KB |
in13.txt | AC | 13 ms | 1792 KB |
in2.txt | AC | 17 ms | 1792 KB |
in3.txt | AC | 17 ms | 1792 KB |
in4.txt | AC | 17 ms | 1792 KB |
in5.txt | AC | 7 ms | 896 KB |
in6.txt | AC | 14 ms | 1792 KB |
in7.txt | AC | 17 ms | 1792 KB |
in8.txt | AC | 14 ms | 1792 KB |
in9.txt | AC | 3 ms | 512 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |