Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for case in range(64):
- number_of_marbles, number_of_queries = map(int, input().split()) # Recebe número de mármores e pesquisas
- if number_of_marbles == 0 and number_of_queries == 0: # Termina o jogo se for 0 mármores e 0 pesquisas
- break
- marbles = [int(input()) for time in range(number_of_marbles)] # Usuário digita os mármores numerados
- marbles.sort() # Organiza os mármores em ordem crescente
- queries = [int(input()) for time2 in range(number_of_queries)] # Usuário digita o mármore que quer pesquisar
- print("CASE# {}:".format(case + 1))
- for query in queries:
- if query in marbles:
- print("{0} found at {1}".format(query, marbles.index(query) + 1)) # Busca a pesquisa do usuário em marbles
- else:
- print("{} not found".format(query)) # Retorna "not found" caso a pesquisa não seja encontrada.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement