Submission

Status:

PP--------

Subtask/Task Score:

20/100

Score: 20

User: anonymous

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

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-01 15:12:33

#include <bits/stdc++.h>

int mp[305][305];
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 > y1) continue;
        int num = mp[x1][y1];
        if (num > 0)a++;
        if (num < 0)b++;
        int temp = num/2;
        int num1 = temp*2;
        if (num == num1) c++;
        else d++;
    } 
    cout << a << ' ' << b << ' ' << c << ' ' << d;
	
	
}