Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: anonymous

Problemset: สำรวจอาเรย์ 1

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-01 15:15:49

#include <bits/stdc++.h>

int mp[405][405];
int a,b,c,d;
using namespace std;

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int x,y;
	cin >> x >> y;
	for(int i=1;i<=x;i++)
	{
		for(int j=1;j<=y;j++)
			{
				cin >> mp[i][j];
			}
	}
	
	int type; cin >> type;
	
	while (type--) {
        int x1,y1;
        cin >> x1 >> y1;
        if (x1 < 1 || x1 > x || y1 < 1 || y1 > y) continue;
        int num = mp[x1][y1];
        if (num > 0)a++;
        if (num < 0)b++;
        if (num % 2 == 0) c++;
        else d++;
    } 
    cout << a << ' ' << b << ' ' << c << ' ' << d;
	
	
}