Submission

Status:

xxxxxxxxxx

Subtask/Task Score:

0/100

Score: 0

User: chillxvtkz

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

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-09 08:45:20

#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;
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; i++)
        {
            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;
        cout << arr[x][y];ct;
    }
    
    
    
    return 0;
}