# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
703208 | delrey | Pareto (COCI17_pareto) | C++14 | 93 ms | 3020 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |