just_a_smallfry's blog

By just_a_smallfry, history, 2 years 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
| Write comment?
»
2 years 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