WA 20分
查看原帖
WA 20分
1086159
zong15632539rongjuan楼主2024/5/20 20:47

https://www.luogu.com.cn/problem/U424662?contestId=170444

我一直找不到错误,这道题能不能帮我调代码?

#include <cstdio>
#include <cmath>
using namespace std;
const int max_n = 550000;
int m, n, a[max_n], N;
struct question {
    float t;
    int epn;
};
question q[max_n];
float sum = 0;
int main() {
    scanf("%d%d", &m, &n);
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    for (int i = 1; i <= n; ++i) 
        scanf("%f%d", &q[i].t, &q[i].epn);
    for (int i = 1; i <= n; ++i)
        sum 
            += round(1.3 
            / (q[i].t + 1.3) * (a[i] * 1.0 / m * q[i].epn));
    N = round(sum);
    printf("%d\n", N);
    return 0;
}
2024/5/20 20:47
加载中...