Task DescriptionDiscussion (0)
Input:
Output:
Task :: O-minomory
Peda, Nikola, Sloba and Tea are spending their preparations for fifth Bubble cup in 2012 playing the minomory game. The game consists of players taking a peek on an array of N different numbers for 10 seconds. After that, they have to answer Q number of questions which are asked by their mental-conditioning coach Mina. This way they practice the technique of broadband view. Each player then answers at what position in the array is a certain number. If the number is not in the array, the answer is 0.
INPUT:
From the standard input read an integer N (0 < N <= 100 000) representing the number of elements in the array.
In the second row, there are N numbers Ai (0 <= Ai < 10 000 000) seperated by a space.
In the third row of input there is an integer Q (0 < Q <= 100 000) representing the number of queries.
In each of the next Q lines there is an integer Qi (0 <= Qi < 10 000 000).
From the standard input read an integer N (0 < N <= 100 000) representing the number of elements in the array.
In the second row, there are N numbers Ai (0 <= Ai < 10 000 000) seperated by a space.
In the third row of input there is an integer Q (0 < Q <= 100 000) representing the number of queries.
In each of the next Q lines there is an integer Qi (0 <= Qi < 10 000 000).
OUTPUT:
The output consists of Q lines. For every number Qi you need to print the position of number Qi in the given array, or print 0 if the number is not in the array.
The output consists of Q lines. For every number Qi you need to print the position of number Qi in the given array, or print 0 if the number is not in the array.
Input:
10
100 233 5 9 11 698 1234 25 113 654
6
233
234
654
1000000
11
100
100 233 5 9 11 698 1234 25 113 654
6
233
234
654
1000000
11
100
Output:
2
0
10
0
5
1
0
10
0
5
1
Submit Solution
Available Languages
Task info
| Name: | O-minomory |
| Time: | 1 sec. |
| Memory: | 64 MB |
| #Tests: | 11 |
| AddedBy: | oduleodule |
Task Ratings
| Difficulty: | 3.6 (26 votes) |
| Quality: | 3.3 (22 votes) |
Acceptance Rate
Recent Submissions
Fastest Solutions
| User | Time |
|---|---|
| cirulapiph | 0.825 s. |
| bl4ck.c0d3r | 0.855 s. |
| crusader | 0.87 s. |
| picsel | 1.53 s. |
| M.Polic | 1.62 s. |
| A.Armin | 1.635 s. |
| matteo123 | 1.665 s. |
| Snip_x | 1.695 s. |
| _qwAker_ | 1.725 s. |
| The_Philosopher | 1.725 s. |
Solved By
Home
Training
Competitions
Forum
FAQ