QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#611094 | #7037. Distance | ucup-team4906# | Compile Error | / | / | C++14 | 1.3kb | 2024-10-04 19:16:03 | 2024-10-04 19:16:04 |
Judging History
answer
int n, m;
long long cnt3, cnt4, cnt;
array<int, maxn> deg, vis;
array<vector<int>, maxn> pre, nxt;
array<array<long long, maxn>, 1 << maxn> dp;
cin >> n >> m;
for (int i = 1; i <= m; i++)
{
int u, v;
cin >> u >> v;
pre[u].emplace_back(v), deg[u]++;
pre[v].emplace_back(u), deg[v]++;
}
for (int u = 1; u <= n; u++)
for (int v : pre[u])
if (deg[u] < deg[v] || deg[u] == deg[v] && u < v)
nxt[u].emplace_back(v);
for (int u = 1; u <= n; u++)
{
for (int v : nxt[u])
vis[v] = 1;
for (int v : nxt[u])
for (int w : nxt[v])
cnt3 += vis[w];
for (int v : nxt[u])
vis[v] = 0;
}
for (int u = 1; u <= n; u++)
{
for (int v : pre[u])
for (int w : nxt[v])
if (deg[u] < deg[w] || deg[u] == deg[w] && u < w)
cnt4 += vis[w]++;
for (int v : pre[u])
for (int w : nxt[v])
vis[w] = 0;
}
for (int i = 0; i < n; i++)
dp[1 << i][i] = 1;
for (int i = 0; i < 1 << n; i++)
for (int u = 0; u < n; u++)
if (dp[i][u])
for (int v : pre[u + 1])
{
if ((i & -i) == 1 << --v)
cnt += dp[i][u];
if ((i & -i) <= 1 << v && ~i & 1 << v)
dp[i | 1 << v][v] += dp[i][u];
}
详细
answer.code:3:1: error: ‘array’ does not name a type 3 | array<int, maxn> deg, vis; | ^~~~~ answer.code:4:1: error: ‘array’ does not name a type 4 | array<vector<int>, maxn> pre, nxt; | ^~~~~ answer.code:5:1: error: ‘array’ does not name a type 5 | array<array<long long, maxn>, 1 << maxn> dp; | ^~~~~ answer.code:7:1: error: ‘cin’ does not name a type 7 | cin >> n >> m; | ^~~ answer.code:8:1: error: expected unqualified-id before ‘for’ 8 | for (int i = 1; i <= m; i++) | ^~~ answer.code:8:17: error: ‘i’ does not name a type 8 | for (int i = 1; i <= m; i++) | ^ answer.code:8:25: error: ‘i’ does not name a type 8 | for (int i = 1; i <= m; i++) | ^ answer.code:15:1: error: expected unqualified-id before ‘for’ 15 | for (int u = 1; u <= n; u++) | ^~~ answer.code:15:17: error: ‘u’ does not name a type 15 | for (int u = 1; u <= n; u++) | ^ answer.code:15:25: error: ‘u’ does not name a type 15 | for (int u = 1; u <= n; u++) | ^ answer.code:19:1: error: expected unqualified-id before ‘for’ 19 | for (int u = 1; u <= n; u++) | ^~~ answer.code:19:17: error: ‘u’ does not name a type 19 | for (int u = 1; u <= n; u++) | ^ answer.code:19:25: error: ‘u’ does not name a type 19 | for (int u = 1; u <= n; u++) | ^ answer.code:29:1: error: expected unqualified-id before ‘for’ 29 | for (int u = 1; u <= n; u++) | ^~~ answer.code:29:17: error: ‘u’ does not name a type 29 | for (int u = 1; u <= n; u++) | ^ answer.code:29:25: error: ‘u’ does not name a type 29 | for (int u = 1; u <= n; u++) | ^ answer.code:39:1: error: expected unqualified-id before ‘for’ 39 | for (int i = 0; i < n; i++) | ^~~ answer.code:39:17: error: ‘i’ does not name a type 39 | for (int i = 0; i < n; i++) | ^ answer.code:39:24: error: ‘i’ does not name a type 39 | for (int i = 0; i < n; i++) | ^ answer.code:41:1: error: expected unqualified-id before ‘for’ 41 | for (int i = 0; i < 1 << n; i++) | ^~~ answer.code:41:17: error: ‘i’ does not name a type 41 | for (int i = 0; i < 1 << n; i++) | ^ answer.code:41:29: error: ‘i’ does not name a type 41 | for (int i = 0; i < 1 << n; i++) | ^ answer.code:42:21: error: ‘u’ does not name a type 42 | for (int u = 0; u < n; u++) | ^ answer.code:42:28: error: ‘u’ does not name a type 42 | for (int u = 0; u < n; u++) | ^