djdibs's blog

By djdibs, history, 13 months ago, In English

Hello Guys,

I am a beginner in the Competitive Programming world and am using java, so can anyone help me so as to how to learn/master the language, what resources should be used any books, etc.

Thanks and regards, See you in the arena.

 
 
 
 
  • Vote: I like it
  • -6
  • Vote: I do not like it

»
13 months ago, # |
  Vote: I like it +6 Vote: I do not like it

I am describing some things which I consider while solving problems with Java:

a). Use BufferedReader class or user defined FastReader class for fast I/O, instead of using Scanner class. You can see here for more info.

b). Prefer Java 8 over Java 11. Java 8 has slightly better throughput than Java 11. Still you can use anything, it won't affect your performance drastically.

c). Most importantly, master collection framework in Java. it helps you to use and manipulate data structures efficiently.

d). Use PrintWriter class for producing output in the console. It is much faster then the general System.out.print().

  • »
    »
    13 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Thanks for the information.

  • »
    »
    7 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Huu bro i also had seen fast scanner used by second thread can you explain this

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It is just a custom template for fast I/O. It uses BufferedReader class but it is a bit different from defined BufferedReader class. All the functions for FastReader class are exactly same as normal Scanner input but because it uses BufferedReader class in it's implementation, it's execution is fast as compared to Scanner.

»
13 months ago, # |
  Vote: I like it +9 Vote: I do not like it

I suggest you just start off by learning the minimum required basics, and learning other things as and when needed. Because there are many optimizations in Java that you won't learn in any programming course but only by experiencing them yourselves.

  • »
    »
    13 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can give some instances of what you are saying.

    • »
      »
      »
      13 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Using ArrayDeque over Stack and Queue is one that comes to mind

  • »
    »
    10 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you can read book CP3 or CP4 by stevan falix halim those are master peices with codes both in JAVA and CPP

»
13 months ago, # |
Rev. 2   Vote: I like it +10 Vote: I do not like it

SecondThread has excellent video about Java setup for competitive programming. link

  • »
    »
    13 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks for the help.

  • »
    »
    5 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You are always doing great.but I want to need some pdf or things that helps to begginer because it is too hard for me to see your video nowdays

»
13 months ago, # |
  Vote: I like it +37 Vote: I do not like it

switch to C++, I used java for 2 years and C++ is a lot better

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I would recommend learning C++. It will make a big impact on the amount of time you spend running tests and coding the solution. Moreover 90% of solutions/tutorials are coded in C++ so it would only make sense to learn C++ for competitive programming.

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Checkout this video (I'm just a beginner and this video will help me too) https://www.youtube.com/watch?v=d7Vqq_CBg-w

»
3 months ago, # |
  Vote: I like it +3 Vote: I do not like it

if you want, you can use my code:

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

tips to get better at java

1.u dont,use c++ instead

»
6 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

CF community has become so condescending these days, some person is new to CP and is asking for help/resources. Yet, I see 6 down-votes in this blog.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    what do u expect? its cf.the community unique charateristic is discouraging newbies