just_a_smallfry's blog

By just_a_smallfry, history, 5 weeks ago, In English

I was trying to solve This_CSES_problem , in which i tried 2 approaches...

1) Sorted first array , then applying binary search on this array (result — TLE )

2) Applied TreeMap , and returned map.floorKey() (result — TLE )

can you help me out?

First_approach
Second_Approach
 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

1) Use replace of TreeMap where-ever possible

2) Use faster I/O

3) Output whole result at once and not in steps..

Here is my java AC JAVA