Submission
Status:
[-SSSSSSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: chillxvtkz
Problemset: เรียงสตริง
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-09 08:52:21
#include <bits/stdc++.h>
#define ll long long
#define ct cout << ' '
#define el cout << endl;
using namespace std;
const int mx = 1e9;
const int mn = -1e9;
int arr[305][305],R,C,t,ch,x,y,bb,rr,eve,od;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> R >> C;
for (int i = 1; i <= R; i++)
{
for (int j = 1; j <= C; j++)
{
cin >> t;
arr[i][j] = t;
}
}
cin >> ch;
for (int i = 0; i < ch; i++)
{
cin >> x >> y;
if(x>R or x<1 or y>C or y<1) continue;
if(arr[x][y]>0) bb=bb+1;
if(arr[x][y]<0) rr=rr+1;
if(arr[x][y]%2==0) eve=eve+1;
if(arr[x][y]%2!=0) od=od+1;
}
cout << bb << " " << rr << " " << eve << " " << od;
return 0;
}