Help needed figuring out what is wrong with my code in codeforces round 758 C

Revision en2, by 100mil, 2021-12-12 12:11:57

So I was solving this question-https://codeforces.me/contest/1608/problem/C This is my solution-https://codeforces.me/contest/1608/submission/138765806 Approach-First I consider the first array which is given to us and sort it in decreasing order. Now I traverse this vector from start and i insert all the elements from the second vector in a set. :-the first element is the greatest so it would be able to defeat all the players. Then when we go to the second player,it can defeat all the players except the players who are before him in the array.So i use the set and see if any of the players can defeat the the first element in the second map(not the data structure). and this way i traverse the whole vector

Now i do the same steps performed above by putting strengths of second map in vector,sort and put the strengths of first map in a set and do the same thing done above.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English 100mil 2021-12-12 12:11:57 27
en1 English 100mil 2021-12-12 11:57:38 941 Initial revision (published)