-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path134.cpp
More file actions
51 lines (49 loc) · 1.05 KB
/
Copy path134.cpp
File metadata and controls
51 lines (49 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<char> curSymptom(n);
for(int i = 0;i<n;i++)
{
cin>>curSymptom[i];
}
int m;
cin>>m;
vector<vector<char>> cure(m,vector<char>(n));
vector<vector<char>> hurt(m,vector<char>(n));
for(int i = 0;i<m;i++)
{
for(int j = 0;j<n;j++)
{
cin>>cure[i][j];
}
for(int j = 0;j<n;j++)
{
cin>>hurt[i][j];
}
}
int q;
cin>>q;
for(int i = 0;i<q;i++)
{
int target;
cin>>target;
int symptomNums = 0;
for(int j = 0;j<n;j++)
{
if(cure[target-1][j]=='1' && curSymptom[j]=='1')
{
curSymptom[j] = '0';
}
if(hurt[target-1][j]=='1' && curSymptom[j]=='0')
{
curSymptom[j] = '1';
}
if(curSymptom[j]=='1') symptomNums++;
}
cout<<symptomNums<<endl;
}
return 0;
}