11991 - Easy Problem from Rujia Liu?


Difficulty : easy

Solution Description :

Searching problem

Input
1 3 2 2 4 3 2 1
1: 1 8  // position of 1's
2: 3 4 7  //position of 2's
3: 2 6   //position of 3's
4: 5 //position of 4's
For query 1 3 --> first 3 position is 2
              2 4 --> do not find second 4 so print 0
              3 2 --> third 2 position is 7
              4 2 --> do not find fourth 2 so print 0

I use vector<long> values[1000001] for solve this problem