Skip to main content
595A. Vitaly and Night
- https://codeforces.com/problemset/problem/595/A
- ///bismillah
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- int floor,flat;
- cin>>floor>>flat;
- int z=0,x,y;
- vector<pair<int,int>>v;
- int limit=flat*floor;
- if(flat==1) limit=floor;
- for(int i=0;i<limit;i++){
- cin>>x>>y;
- v.push_back(make_pair(x,y));
- }
-
- for(int i=0;i<=flat*floor-1;i++){
- if (v[i].first==0 and v[i].second==0)
- z++;
- //cout<<v[i].first<<" "<<v[i].second<<endl;
- }
- cout<< floor*flat-z;
-
- return 0;}
Comments
Post a Comment