编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#80604 | #1022. jwp的排队难题 | Compile Error | 0 | 0 ms | 0 K | C / 526 B | 010415 | 2022-07-18 13:52:25 |
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int n;
long long ans, t = 0;
struct node {
long long a, b;
};
node s[100010];
bool cmp(node A, node B) { return A.a * B.b > A.b * B.a; }
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%lld%lld", &s[i].a, &s[i].b);
}
sort(s + 1, s + n + 1, cmp);
for (int i = 1; i <= n; i++) {
t += s[i].b;
ans += t * s[i].a;
}
printf("%lld\n", ans);
system("pause");
return 0;
}
编译信息
/sandbox/1/a.c:3:9: fatal error: 'algorithm' file not found
#include<algorithm>
^~~~~~~~~~~
1 error generated.