QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#387418 | #3729. 有向无环图 | ucup-team1251 | Compile Error | / | / | C++17 | 747b | 2024-04-12 14:51:24 | 2024-04-12 14:51:25 |
Judging History
This is the latest submission verdict.
- [2024-04-12 14:51:25]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-04-12 14:51:24]
- Submitted
answer
#include <bits\stdc++.h>
#define int long long
using namespace std;
int mod = 1e9 + 7;
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
while (cin >> n >> m)
{
vector <vector <int> > s(n + 1);
vector<int> a(n + 1), b(n + 1), in(n + 1);
for (int i = 1; i <= n; i++)
{
cin >> a[i] >> b[i];
}
for (int i = 1; i <= m; i++)
{
int u, v;
cin >> u >> v;
s[u].push_back(v);
in[v]++;
}
int ans = 0;
auto dfs = [&] (auto self, int u, int sum) -> void
{
ans = (ans + sum * b[u] % mod) % mod;
for (auto i : s[u])
{
self(self, i, sum + a[u]);
}
};
for (int i = 1; i <= n; i++)
{
if (!in[i])
{
dfs(dfs, i, 0);
}
}
cout << ans << '\n';
}
return 0;
}
詳細信息
answer.code:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.