QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#371465 | #905. 三元环枚举 | Isrothy | Compile Error | / | / | C++23 | 1.2kb | 2024-03-30 12:49:53 | 2024-03-30 12:49:54 |
Judging History
This is the latest submission verdict.
- [2024-03-30 12:49:54]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-03-30 12:49:53]
- Submitted
answer
#include <cstdio>
#include <vector>
#include <span>
auto three_membered_rings(std::span<std::vector<int>> adj) {
auto n = adj.size() - 1;
std::vector<size_t> rank(n + 1);
std::vector<int> vis_time(n + 1);
std::vector<std::vector<int>> f(n + 1);
for (int u = 1; u <= n; ++u) {
rank[u] = (int64_t) adj[u].size() * (n + 1) + u;
}
for (int u = 1; u <= n; ++u) {
for (auto v: adj[u]) {
if (rank[u] < rank[v]) {
f[u].push_back(v);
}
}
}
int res = 0;
for (int u = 1; u <= n; ++u) {
for (auto v: f[u]) {
vis_time[v] = u;
}
for (auto v: f[u]) {
for (auto w: f[v]) {
if (vis_time[w] == u) {
++res;
}
}
}
}
return res;
}
int main() {
int n, m;
scanf("%d%d", &n, &m);
std::vector<std::vector<int>> adj(n + 1);
for (int i = 0; i < m; ++i) {
int u, v;
scanf("%d%d", &u, &v);
--u;
--v;
adj[u].push_back(v);
adj[v].push_back(u);
}
printf("%d\n", three_membered_rings(adj));
return 0;
}
詳細信息
answer.code: In function ‘auto three_membered_rings(std::span<std::vector<int> >)’: answer.code:10:20: error: ‘int64_t’ was not declared in this scope 10 | rank[u] = (int64_t) adj[u].size() * (n + 1) + u; | ^~~~~~~ answer.code:4:1: note: ‘int64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? 3 | #include <span> +++ |+#include <cstdint> 4 | auto three_membered_rings(std::span<std::vector<int>> adj) { answer.code: In function ‘int main()’: answer.code:36:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 36 | scanf("%d%d", &n, &m); | ~~~~~^~~~~~~~~~~~~~~~ answer.code:40:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 40 | scanf("%d%d", &u, &v); | ~~~~~^~~~~~~~~~~~~~~~