编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#5205 #1033. 电子钱包 Compile Error 0 0 ms 0 K C++ 17 (Clang) / 768 B t330026229 2024-02-25 16:55:46
显示原始代码
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, k, a[50][N], ans = 0, row[50], cnt = 0;
void dfs(int cur) {
    if (cur > m - k + 1) {
        ans = max(ans, cnt);
        return;
    }
    for (int i = 1; i <= n; i++) {
        if (row[i] == 0) {
            for (int j = cur; j <= cur + k - 1 && j <= m; j++) {
                oup += a[i][j];
                row[i] = 1;
                dfs(cur + 1);
                row[i] = 0;
                oup -= a[i][j];
            }
        }
    }
}
int main() {
    scanf("%d%d%d", &n, &m, &k);
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            scanf("%d", &a[i][j]);
        }
    }
    dfs(1);
    printf("%d\n", ans);
    return 0;
}

编译信息

/sandbox/1/a.cpp:18:17: error: use of undeclared identifier 'oup'
                oup+=a[i][j];
                ^
/sandbox/1/a.cpp:22:17: error: use of undeclared identifier 'oup'
                oup-=a[i][j];
                ^
2 errors generated.