Submission #1157577
Source Code Expand
#include<iostream> #include<algorithm> #define MN 100000 int N; long A[MN]; void input(){ std::cin >> N; for( int i = 0; i < N; i++ ){ std::cin >> A[i]; } std::sort(&A[0], &A[N]); return; } int func(int i){ long s = A[i]; for( int j = 0; j < N; j++ ){ if( i == j ){ continue; } if( A[j] > 2 * s ){ return 0; } s += A[j]; } return 1; } void run(){ int re = 0; for( int i = 0; i < N; i++ ){ re += func(i); } std::cout << re << std::endl; return; } int main(){ input(); run(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Colorful Creatures |
User | suzutaku_cse |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 560 Byte |
Status | TLE |
Exec Time | 2103 ms |
Memory | 1024 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | TLE | 2103 ms | 1024 KB |
in10.txt | AC | 1323 ms | 512 KB |
in11.txt | TLE | 2103 ms | 1024 KB |
in12.txt | TLE | 2103 ms | 1024 KB |
in13.txt | TLE | 2103 ms | 1024 KB |
in2.txt | TLE | 2103 ms | 1024 KB |
in3.txt | TLE | 2103 ms | 1024 KB |
in4.txt | TLE | 2103 ms | 1024 KB |
in5.txt | AC | 1446 ms | 512 KB |
in6.txt | TLE | 2103 ms | 1024 KB |
in7.txt | TLE | 2103 ms | 1024 KB |
in8.txt | TLE | 2103 ms | 1024 KB |
in9.txt | AC | 147 ms | 384 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |