Submission

Status:

xxxxxxxxxx

Subtask/Task Score:

0/100

Score: 0

User: thitit

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

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-05 22:11:35

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    cin.tie(0)->sync_with_stdio(false);
    int a,b;
    cin >> a >> b;
    vector<vector<int>> num(a,vector<int>(b));

    for (int i = 0; i < a; i++) {
        for (int j = 0; j < b; j++) {
            cin >> num[i][j];
        }
    }

    int how_many;
    cin >> how_many;
    int x;
    int y;
    int positive = 0;
    int negative = 0;
    int odd = 0;
    int even = 0;

    for (int i = 0; i < how_many; i++) {
        cin >> x;
        cin >> y;
        if (num[x][y] > 0) {
            positive = positive + 1;
        }
        if (num[x][y] < 0) {
            negative = negative + 1;
        }
        if (num[x][y] % 2 == 1) {
            odd = odd + 1;
        } else {
            even = even + 1;
        }
    }

    cout << positive << " " << negative << " " << odd << " " << even;

}