Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <string>
- #include <stack>
- #include <set>
- #include <map>
- #define pii pair <int,int>
- using namespace std;
- using ll = long long;
- using ld = long double;
- void cv(vector <int> &v){
- for (auto x: v) cout<<x<<' ';
- cout<<"\n";
- }
- void cvl(vector <ll> &v){
- for (auto x: v) cout<<x<<' ';
- cout<<"\n";
- }
- void cvv(vector <vector <int> > &v){
- for (auto x: v) cv(x);
- cout<<"\n";
- }
- void cc(vector <char> v){
- for (char x: v) cout<<x;
- cout<<"\n\n";
- }
- void cb(vector <bool> v){
- for (bool x: v) cout<<x;
- cout<<"\n\n";
- }
- int main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- int n,m; cin>>n>>m;
- vector <bool> chk(m, 0), gn(m, 0);
- int couch=0, bad=0;
- for (int i = 0; i < n;++i){
- char act; cin>>act;
- vector <bool> now(n);
- for (int j =0;j<m;++j){
- char x; cin>>x;
- if (x == '0') now[j] = 0;
- else now[j] = 1;
- //cin>>now[j];
- }
- if (act == '+'){
- //continue;
- for (int j = 0;j<m;++j){
- if (now[j]){
- //if (chk[j])
- gn[j] = 1;
- }
- }
- }
- else{
- bool ok = 1;
- //couch++;
- //continue;
- for (int j = 0 ; j < m;++j){
- if (now[j]){
- if (!gn[j]){
- ok = 0;
- }
- gn[j] = 0;
- }
- }
- if (!ok){
- bad++;
- }
- }
- //cout<<"now\n";
- //cc(now);
- //cout<<"chk\n";
- //cb(chk);
- }
- cout<<bad<<"\n";
- }
- /*
- 4 3
- + 111
- - 101
- + 001
- - 111
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement