ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#211397 | #3806. 逃跑 | Larryia | Compile Error | / | / | C++11 | 830b | 2024-08-11 10:37:36 | 2024-08-11 13:03:08 |
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int m, n, k, x[10];
const int N = 2e5 + 10;
ll a[N][10];
ll dp(int s, int x[], int tr) {
if (s == n + 1 || tr == 0) {
ll ans = 0;
for (int i = 1; i <= m; i++) {
ans += abs(x[i]);
}
return ans;
}
// 1.不选a[s]
ll ans;
for (int i = 1; i <= m; i++) {
x[i] += a[s][i];
}
ans = dp(s + 1, x, tr);
for (int i = 1; i <= m; i++) {
x[i] -= a[s][i];
}
ans = max(ans, dp(s + 1, x, tr - 1));
return ans;
}
int main() {
scanf("%d%d%d", &n, &m, &k);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
scanf("%lld", &a[i][j]);
}
}
prinf("%lld", dp(1, x, k));
return 0;
}
详细
answer.code: In function 'int main()': answer.code:35:30: error: 'prinf' was not declared in this scope prinf("%lld", dp(1, x, k));\x0d ^ answer.code:29:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d%d", &n, &m, &k);\x0d ^ answer.code:32:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unu...