QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#696737#9238. Treeivan_alexeev#Compile Error//C++23620b2024-11-01 00:58:262024-11-01 00:58:26

Judging History

你现在查看的是最新测评结果

  • [2024-11-01 00:58:26]
  • 评测
  • [2024-11-01 00:58:26]
  • 提交

answer

#include <bits/stdc++.h>
#include "message.h"

using namespace std;

#ifdef lisie_bimbi
#else
#define endl '\n'
#endif
typedef long long ll;

#define int long long

const ll inf = 1'000'000'000;
int n;
vector<vector<int>> v;
vector<int> w;
int l, r;

int dfs(int u, int l, int r){
    int sum = 0;
    int ans = 0;
    for(auto i : v[u]){
        ans += dfs(i, l, r);
        sum += r;
    }
    ans += w[u] * (r - sum);
    return ans;
}

void init(vector<int> p, vector<int> W){
    for(int i = 1; i < n; i++){
        v[p[i]].push_back(i);
    }
    w = W;
}

long long query(int L, int R){
    return dfs(0, L, R);
}

詳細信息

answer.code:2:10: fatal error: message.h: No such file or directory
    2 | #include "message.h"
      |          ^~~~~~~~~~~
compilation terminated.