QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#308214 | #6659. 외곽 순환 도로 2 | SampsonYW | Compile Error | / | / | C++17 | 1.6kb | 2024-01-19 18:54:24 | 2024-01-19 18:54:25 |
Judging History
你现在查看的是测评时间为 2024-01-19 18:54:25 的历史记录
- [2024-01-19 18:54:25]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-01-19 18:54:24]
- 提交
answer
#include <bits/stdc++.h>
#define il inline
#define re register
#define ll long long
#define pii pair<int, int>
#define fi first
#define se second
#define eb emplace_back
#define SZ(v) (int)v.size()
#define ALL(v) v.begin(), v.end()
using namespace std;
#define N 100005
il void chkmin(ll &x, ll y) {(x > y) && (x = y);}
int n, m; ll v[N];
vector<pair<int, ll>> son[N];
ll dp[N][2][2][2], tmp[2][2][2];
#define FOR(i, L, R) for(re int i = (L); i <= (R); ++i)
#define FR(a, b, c) FOR(a, 0, 1) FOR(b, 0, 1) FOR(c, 0, 1)
il void dfs(int x) {
if(son[x].empty()) {
FOR(k, 0, 1) dp[x][k][k][k] = 0; ++m; return ;
}
bool F = 0; ll d;
for(auto it : son[x]) {
int y = it.fi; ll w = it.se; dfs(y);
memcpy(tmp, dp[x], sizeof(tmp));
memset(dp[x], 0x7f / 2, sizeof(dp[x]));
if(!F) FOR(A, 0, 1) FR(a, b, c)
chkmin(dp[x][A][b][c], dp[y][a][b][c] + (A == a) * w);
else FR(A, B, C) FR(a, b, c)
chkmin(dp[x][A][B][c], tmp[A][B][C] + dp[y][a][b][c] + (A == a) * w + (C == b) * d);
F = 1, d = v[m];
// cerr << "edge " << x << " " << y << " " << d << "\n";
}
}
long long place_police(vector<int> P, vector<long long> C, vector<long long> W) {
n = SZ(P) + 1;
for(re int i = 0; i < n - 1; ++i)
son[P[i] + 1].eb(i + 2, C[i]);
// cerr << P[i] + 1 << " " << i + 2 << " " << C[i] << "\n";
for(auto x : W) v[++m] = x;
memset(dp, 0x7f / 2, sizeof(dp));
m = 0, dfs(1); ll ans = 1e18;
// cerr << m << "\n";
// FOR(x, 1, n) FR(a, b, c) cerr << x << "," << a << "," << b << "," << c << " = " << dp[x][a][b][c] << "\n";
FR(a, b, c) chkmin(ans, dp[1][a][b][c] + (b == c) * v[m]);
return ans;
}
詳細信息
cc1plus: fatal error: implementer.cpp: No such file or directory compilation terminated. answer.code: In function ‘void dfs(int)’: answer.code:21:9: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 21 | FOR(k, 0, 1) dp[x][k][k][k] = 0; ++m; return ; | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:28:16: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 28 | if(!F) FOR(A, 0, 1) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:28:28: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 28 | if(!F) FOR(A, 0, 1) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:28:25: note: in expansion of macro ‘FR’ 28 | if(!F) FOR(A, 0, 1) FR(a, b, c) | ^~ answer.code:28:31: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 28 | if(!F) FOR(A, 0, 1) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:28:25: note: in expansion of macro ‘FR’ 28 | if(!F) FOR(A, 0, 1) FR(a, b, c) | ^~ answer.code:28:34: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 28 | if(!F) FOR(A, 0, 1) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:28:25: note: in expansion of macro ‘FR’ 28 | if(!F) FOR(A, 0, 1) FR(a, b, c) | ^~ answer.code:30:13: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 30 | else FR(A, B, C) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:30:10: note: in expansion of macro ‘FR’ 30 | else FR(A, B, C) FR(a, b, c) | ^~ answer.code:30:16: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 30 | else FR(A, B, C) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:30:10: note: in expansion of macro ‘FR’ 30 | else FR(A, B, C) FR(a, b, c) | ^~ answer.code:30:19: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 30 | else FR(A, B, C) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:30:10: note: in expansion of macro ‘FR’ 30 | else FR(A, B, C) FR(a, b, c) | ^~ answer.code:30:25: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 30 | else FR(A, B, C) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:30:22: note: in expansion of macro ‘FR’ 30 | else FR(A, B, C) FR(a, b, c) | ^~ answer.code:30:28: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 30 | else FR(A, B, C) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:30:22: note: in expansion of macro ‘FR’ 30 | else FR(A, B, C) FR(a, b, c) | ^~ answer.code:30:31: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 30 | else FR(A, B, C) FR(a, b, c) | ^ answer.code:17:33: note: in definition of macro ‘FOR’ 17 | #define FOR(i, L, R) for(re int i = (L); i <= (R); ++i) | ^ answer.code:30:22: note: in expansion of macro ‘FR’ 30 | else FR(A, B, C) FR(a, b, c) | ^~ answer.code: In function ‘long long int place_police(std::vect...