Submission #1189536
Source Code Expand
#include<stdio.h> #include<algorithm> using namespace std; long long msize[100005]; main() { long long num; scanf("%lld",&num); for(long long i=0;i<num;i++) { scanf("%lld",&msize[i]); } sort(msize,msize+num); long long cnt=0,chk=0; for(long long i=0;i<num;i++) { chk=0; long long sizei=msize[i]; for(long long j=0;j<i;j++) { sizei+=msize[j]; } for(long long j=i+1;j<num;j++) { if(msize[j]<=sizei*2) { sizei+=msize[j]; } else { chk=1; break; } } if(chk==0) { cnt++; } } printf("%lld\n",cnt); }
Submission Info
Submission Time | |
---|---|
Task | B - Colorful Creatures |
User | vjudge1 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 777 Byte |
Status | TLE |
Exec Time | 2103 ms |
Memory | 896 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld",&num); ^ ./Main.cpp:11:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld",&msize[i]); ^
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 | 896 KB |
in10.txt | AC | 776 ms | 512 KB |
in11.txt | TLE | 2103 ms | 896 KB |
in12.txt | TLE | 2103 ms | 896 KB |
in13.txt | TLE | 2103 ms | 896 KB |
in2.txt | TLE | 2103 ms | 896 KB |
in3.txt | TLE | 2103 ms | 896 KB |
in4.txt | TLE | 2103 ms | 896 KB |
in5.txt | AC | 868 ms | 512 KB |
in6.txt | TLE | 2103 ms | 896 KB |
in7.txt | TLE | 2103 ms | 896 KB |
in8.txt | TLE | 2103 ms | 896 KB |
in9.txt | AC | 86 ms | 256 KB |
sample1.txt | AC | 1 ms | 128 KB |
sample2.txt | AC | 0 ms | 128 KB |
sample3.txt | AC | 0 ms | 128 KB |