Please Help Me to find edge case in this problem

Revision en3, by noobCoderUltraProMax, 2023-01-20 10:24:30

Problem Link:https://codeforces.net/contest/1779/problem/D

Code Link:https://codeforces.net/contest/1779/submission/189809516

Logic: i am using: first i am handling No case when v1[i]<v2[i], then i am storing count of all razors in a map. Now i iterate through 0 to n-1 and check if v1[i]>v2[i] if it so then i check if it the first time i have encountered this element, if yes then i need to use razor so i do mp[v2[i]]-- and update its position in other map, if it is not the first time then i range query from last position where i have seen that element to current position for max element. if it is greater than current element then i use razor an if it any moment mp[v2[i]] is required but it is 0 then i set bool flag var to false.

Difficulty: i am getting WA on test case 2 sub-test 252.

Edit: i found the bug.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English noobCoderUltraProMax 2023-01-20 10:24:30 28 Tiny change: 'est 252.\n' -> 'est 252.\n\nEdit: i found the bug.\n\n'
en2 English noobCoderUltraProMax 2023-01-20 10:13:36 65
en1 English noobCoderUltraProMax 2023-01-20 09:41:39 789 Initial revision (published)