Help Needed In Recent Contest's Problem C.

Правка en2, от noobCoderUltraProMax, 2022-05-08 21:12:48

My Code link:https://mirror.codeforces.com/contest/1678/submission/156355337

My Logic: Store all Pairs [Ai,Aj] where Ai>Aj in a 2D Vector and similarly do for Ai<Aj. Now Make 4 length arrays using these two arrays as they have required Pa < Pc and Pb>Pd pairs. If they meet the given condition check if position of elements of subsequence in original array is sorted or not using map, if sorted increment the answer.

Problem: It TLE's.

Thinking: I tired to think of optimization but unable to come up with. So can anyone help?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский noobCoderUltraProMax 2022-05-08 21:12:48 2 Tiny change: 'equired Pa<Pc and Pb>' -> 'equired Pa < Pc and Pb>'
en1 Английский noobCoderUltraProMax 2022-05-08 21:12:10 570 Initial revision (published)