1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000100000000000000000
<1001911 bytes omitted>
用户输出
553
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#47976 | #1253. 开课通知 | Accepted | 100 | 1192 ms | 40732 K | C++ 17 / 809 B | Komeiji Koishi | 2021-05-10 9:28:51 |
#include <bits/stdc++.h>
using namespace std;
int n, m, cnt = 0, d[1000005], q[1000005], l, r;
int h, v;
char t[1000005];
vector<int> s[1000005];
set<int> st[1000005];
int main() {
// freopen("1.in","r",stdin);
scanf("%d%d", &n, &m);
// int c=getchar();
for (int i = 1; i <= n; i++) {
scanf("%s", t + 1);
for (int j = 1; j <= m; j++) {
// c=getchar();
// printf("%d %d %c\n",i,j,c);
if (t[j] == '1')
s[i].push_back(1), d[j]++, st[j].insert(i);
else
s[i].push_back(0);
}
// c=getchar();
}
l = r = 1;
for (int i = 1; i <= m; i++)
if (d[i] == 1)
q[r++] = i;
while (l < r) {
h = q[l++];
if (d[h] < 1)
continue;
h = *st[h].begin();
cnt++;
for (int j = 0; j < m; j++) {
if (s[h][j] == 1) {
d[j + 1]--;
st[j + 1].erase(h);
if (d[j + 1] == 1)
q[r++] = j + 1;
}
}
}
printf("%d\n", n - cnt);
return 0;
}
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000100000000000000000
<1001911 bytes omitted>
用户输出
553
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1001911 bytes omitted>
用户输出
390
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1001911 bytes omitted>
用户输出
570
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000
<1001911 bytes omitted>
用户输出
898
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1001911 bytes omitted>
用户输出
959
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000
<1001911 bytes omitted>
用户输出
985
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1001911 bytes omitted>
用户输出
992
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
<1001911 bytes omitted>
用户输出
995
系统信息
Exited with return code 0
1000 1000
00000000000000000000000000000000000000000100000000000000000000000000000000000000000000000
<1001911 bytes omitted>
用户输出
1000
系统信息
Exited with return code 0
1000 1000
00000000000000010000000000000000000000000000000000000000000000000000000000000000000000000
<1001911 bytes omitted>
用户输出
998
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
9998
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
9997
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
10000
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
9999
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
10000
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
10000
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
10000
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
10000
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
1000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
10000
系统信息
Exited with return code 0
10000 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
000000
<119910 bytes omitted>
用户输出
10000
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4930
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4922
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4940
系统信息
Exited with return code 0
5000 200
000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4944
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4960
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4967
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4980
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4980
系统信息
Exited with return code 0
5000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<1009910 bytes omitted>
用户输出
4987
系统信息
Exited with return code 0