diff --git a/OnlineJudges/lydsy/lydsy.cpp b/OnlineJudges/lydsy/lydsy.cpp index 3b74c4d..31329c5 100644 --- a/OnlineJudges/lydsy/lydsy.cpp +++ b/OnlineJudges/lydsy/lydsy.cpp @@ -1,6 +1,25 @@ #include using namespace std; +int a[205]; +int Log(int x) +{ + for (int i = 0;; i++) + if ((1 << i) > x + 1) + return i; + return -1; +} int main() { + int n; + double k, c; + scanf("%d%lf%lf", &n, &k, &c); + for (int i = 0; i < n; i++) scanf("%d", a + i); + sort(a, a + n); + reverse(a, a + n); + int sum = 0; + double ans = 0; + for (int i = 0; i < n; i++) sum += a[i]; + for (int i = 0; i < n; i++) ans += a[i] * (Log(i) * k + c); + printf("%.3lf", ans / sum); return 0; } \ No newline at end of file diff --git a/退役狗的挣扎/一篇已经弃坑的文档/LICENSE b/退役狗的挣扎/一篇已经弃坑的文档/LICENSE new file mode 100644 index 0000000..f7e4436 --- /dev/null +++ b/退役狗的挣扎/一篇已经弃坑的文档/LICENSE @@ -0,0 +1,15 @@ +2019.08.04 VERSION 0.1 + +You can use this article freely for learning purpose only. + +Following terms should be followed. +NoDerivatives: + Partial copy and any redistribution after modification is not allowed. + If you remix, transform, or build upon this article, + you may not distribute the modified one. +NonCommercial: + You may not use this article for commercial purposes. + +Exclude: + Special access right has granted to @Nonad for writing our new document. + She is allowed to bypass all the restrictions above. \ No newline at end of file