Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long a[110][110];
- long long n,i,j,r,c,s,x,m;
- int main()
- {
- cin>>n>>m;
- for(i=1; i<=n; i++){
- for(j=1; j<=m; j++){
- cin>>a[i]>>a[j];
- }
- }
- cin>>x;
- for(i=1; i<=x; i++){
- cin>>r>>c;
- s+=a[r][c];
- a[r][c]=0;
- }
- cout<<s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement