You are not logged in. Please login at www.codechef.com to post your questions!

×

new to programming

hi

i am very new to c and C++ programming

i find most of the programs even in easy section tough and solutions are like alien to me

what should i do?

asked 20 Jun '13, 01:27

royoy's gravatar image

0★royoy
1112
accept rate: 0%


Hello,

Well, once again, here we are back on this same old topic...

I have seen and agreed and even upvoted basically any answer regarding this question, mostly, because as @junior94 said here, it all depends on each person's background, on each person's logical thinking, fast typing, creativity, or any other completely irrelevant aspects in terms of helping you on your question.

However, there IS something you can actually do about this matter and that I find (as time passes by) to be true.

That thing is practice. That is all. Nothing else.

At some point, when you are attempting a problem whose theory that lies behind it is totally new to you, I would recommend you to read wikipedia articles about it ALONG with a good reference book (I own a paperback copy of the worldwide famous "Introduction to Algorithms", by CLRS and I read it from time to time). That study is NOT for problem-solving purposes. That study will serve for the concepts to stay in your mind while you sleep, to "tune" your head to that concepts if you'd like to think about it that way.

It may seem demotivating that even after reading some dozens (possibly hundreds) of pages you see no improvement on your contest performance, but, as you will see, if, after attempting a problem many times you read its editorial here (the editorials ARE the best learning resource I've ever came across on ALL of Internet and I am not exxagerating) and if alongside with it you search and read some AC codes in your favourite language (choose codes from "middle and down of the table", as codes by "pros" are usually too syntactically advanced for humans to understand :p ) you will begin to spot patterns that were before hidden to your eyes and brain... And, as time passes by, you will get better and better, this, I can tell with 100% sure :D

Just keep learning from other coders and from editorials, be enthusiastic... and you will get better... By better I don't mean becoming a top competitor, but surely you will be able to solve 4/5 problems on a more consistent basis as time will pass by.. It might take 1,2 months/years depending on your previous skill... But you will get there if you walk along the path of enthusiasm and work... (some awesome coders from here taught me this!! Kudos @xpertcoder and @junior94 and @scep2 and @devanshug).

Best of luck,

Bruno

link

answered 20 Jun '13, 02:12

kuruma's gravatar image

3★kuruma
17.6k72143209
accept rate: 8%

edited 20 Jun '13, 02:13

couldn't have put this better - "as codes by "pros" are usually too syntactically advanced for humans to understand :p"...:D

(20 Jun '13, 09:14) scep24★

@kuruma I just started with "Introduction to Algorithms". What kind of approach did you follow to read it? Read it from beginning to end or picking out problems that you were facing?

(20 Jun '13, 11:42) anshbansal1★
1

@kuruma: "once again, here we are back on this same old topic...". I had an urge to say this so many times. It looks like this question will keep appearing from time to time even though there are a lot of posts regarding this... There should be a welcome page or something like that to guide new users to the right direction. For the time being all we can do as a community is try to guide them ourselves :)

(20 Jun '13, 15:23) junior944★

Yes, this is a topic that will come up all the time... Damned Belarussian geniuses :p It is actually one the most recurring topics which has no right answer... But, as you said, all we can do as a great community we are is to help people with our own experiences the best we can :)

(20 Jun '13, 16:36) kuruma3★

learn & practice, especially persist

link

answered 20 Jun '13, 03:47

mabraygas's gravatar image

5★mabraygas
162
accept rate: 0%

Well for starters you can begin with writing down the pseudocode of how you would proceed in solving the problem and check manually if it works for small inputs. Code it up and then see the verdict of the judge. Don't get disheartened if it results in a TLE or WA. Just identify the corner cases or sometimes it might need you to start off thinking with a totally different approach. If not able to get the reason for why your code doesn't work, read the editorials. Usually you may find that the method you used is right but its translation into the programming language might be the problem. Now it comes up to reading others code. A good knowledge of data structures and understanding of the programming language of your choice is essential. You can surf it online, watch various video lectures of universities etc.

This may seem really tedious at first and you may think your progress ain't exponentially rising instantly but that's when you don't give in and keep putting your level best. Keep practicing and code with this ideal - "Can it be done better?". As you keep practicing you will learn various algorithms and more and eventually you will rise up in rankings and improve your coding skills!

link

answered 20 Jun '13, 09:32

scep2's gravatar image

4★scep2
2913
accept rate: 0%

Hello, Some answers are already been given to you so just follow them. As as u said "the solutions are aliens to me". It not only you be sometime most of us find some solutions aliens.

So, in case you browse through the solutions, try to find codes which are neat and clean so that it readable and you can understand how the function are called etc. I have personally found that the fastest codes are harder to understand. :P

You will improve with practice as I am also trying to do so. Initially I solved only 1 problem in the contest but now I am able to solve upto 3. Not to say but all those goes into "Easy" section.. lol

link

answered 20 Jun '13, 12:46

ajit_a's gravatar image

2★ajit_a
41113
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,840
×1,461
×190

question asked: 20 Jun '13, 01:27

question was seen: 1,261 times

last updated: 20 Jun '13, 16:36