# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
703208 | delrey | Pareto (COCI17_pareto) | C++14 | 93 ms | 3020 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 <bits/stdc++.h>
using namespace std;
int n, acc[300000];
int main()
{
long long sum = 0;
cin>>n;
for(int i = 0; i < n; i++)
{
cin>>acc[i];
sum += acc[i];
}
sort(acc, acc + n);
double a = 100, b = -1;
long long sumx = 0;
for(int i = n - 1; i >= 0; i--)
{
double x = (n - i);
x /= (double)n / 100;
sumx += acc[i];
double y = sumx;
y /= (double)sum / 100;
if(b - a < y - x)
{
a = x;
b = y;
}
//cout<<x<<" "<<y<<endl;
}
cout<<a<<endl<<b<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |