编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#49036 | #1253. 开课通知 | Compile Error | 0 | 0 ms | 0 K | C++ 17 / 912 B | Chtapodia | 2021-05-20 11:55:17 |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 2;
int num[N] = { 0 };
string a[N];
int check(int num[], int m) {
for (int i = 0; i < m; i++) {
if (num[i] == 1)
return i;
}
return 0;
}
int main() {
int n;
int m;
cin >> n >> m;
int result = n;
for (int i = 0; i < n; i++) {
cin >> a[i];
for (int j = 0; j < m; j++) {
num[j] += a[i][j] - '0';
}
}
int c;
while (c = check()) {
result--;
for (int i = 0; i < n; i++) {
if (a[i][c] == '1') {
for (int j = 0; j < m; j++) {
num[j] -= a[i][j] - '0';
a[i][j] = '0';
}
break;
}
}
}
cout << result << endl;
return 0;
}
编译信息
/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:30:22: error: too few arguments to function 'int check(int*, int)'
while (c = check())
^
/sandbox/1/a.cpp:6:5: note: declared here
int check(int num[],int m)
^~~~~