-
-
Save fredbr/51149061c1bdacf385e54918a591c039 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
//solucao de Davi Gabriel | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXY = 505; | |
//Declaro MAXY sendo o valor máximo de x, y = 500 | |
int mark[MAXY][MAXY]; //Crio a matriz dos nossos quadrantes | |
//Inicialmente cada posição dessa matriz é 0 | |
int main() { | |
int n, x, y; | |
cin >> n; | |
bool atingido = 0; //Nossa resposta sera "atingido" que retorna | |
//0 se for um mito e 1 se for verdade | |
for(int i = 0; i < n; i++){ | |
cin >> x >> y; //Leio as coordenadas do quadrante atingido pelo raio | |
if(mark[x][y] == 0){ //Se nenhum raio tiver atingido este quadrante | |
mark[x][y] = 1; //Marco que ele foi atingido | |
} | |
else{ //Se ele já tiver sido atingido, então não é um mito | |
atingido = 1; | |
} | |
} | |
cout << atingido << "\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment