# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3531 | eldkqmfhf123 | King of penalty (kriii1_K) | C++98 | 68 ms | 3112 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
#include<algorithm>
using namespace std;
long long int Data[100010];
//long long int sum[100010];
int main()
{
long long int n, m;
cin >> m >> n;
long long int i,j;
long long int sum=0;
for(i=0;i<n;i++)
{
cin >> Data[i];
sum += Data[i];
}
std::sort(Data,Data+n);
for(i=n;i>=1;i--)
{
if(sum >= m)
{
sum -= Data[i-1];
continue;
}
long long int Arr[100010]={0,};
Arr[0] = Data[i-1];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |