Last active
June 21, 2019 22:49
-
-
Save ampulhetadosaber/5d6a693cf06432544a58f90a105f548b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
const int MAXN = 1010; | |
const int MAXM = 1010; | |
int N, M, Q, I, J; // Declaro todas as variáveis necessárias | |
int pontos[MAXN][MAXM]; // Declaro a matriz de duas dimensões que responderá as perguntas | |
int main () | |
{ | |
cin >> N >> Q; // Leio a quantidade de pessoas que há no jogo e a quantidade de lançamentos que cada um possuí | |
for(int i = 0; i < N; i++) // A variável i representa o índice do jogador | |
{ | |
for(int j = 0; j < M; j++) // A variável j representa o índice do lançamento | |
{ | |
cin >> pontos[i][j]; // Leio a quantidade de pontos que o jogador i fez no seu j-ésimo lançamento | |
} | |
} | |
cin >> Q; // Leio a quantidade de perguntas | |
for(int i = 0; i < N; i++) | |
{ | |
cin >> I >> J; // Leio o índice do jogador e o índice do lançamento | |
cout << pontos[I][J] << "\n"; // Imprimo a resposta | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment