Competition programming is different from actual programming

Source: Internet
Author: User

Original ENGLISH: Competitive programming: How is competitive programming different from real-life programming?

You have a knife in the jungle, and someone asks you to kill a puma. Anyone will ask, "What is a puma doing in the jungle ?!", Besides programmers. However, this is not what you are trained as a programmer to do. You should solve the problem here, rather than questioning the problem.

Years of training have taught you a lot. You use a knife to sharpen a wooden stick and cut down a cane to shake a sharp stone at one end. Maybe you are from a top-notch university and you have learned to extract necessary ingredients from plants and insects to increase the toxicity of weapons.

You firmly believe that you have an effective and competent way to kill lions, and you begin to work hard to complete the task. Maybe your wooden stick is too short or your venom does not work. It doesn't matter. You can improve your methods and try again tomorrow.

Then someone found a way to collect chemicals in the jungle to make mild explosives. The method of finishing the task is far from the best. However, it is still a simple method and continues to be taught at school. Each lion hunter will be taught how to build his tools from scratch.

This is a "realistic" programming.

In competing programming, you start with the same resource (knife) and expect you to kill the lion in two minutes.

As a beginner, you will stare at Lions and do nothing.

Soon you will understand that if you have killed a squirrel, maybe the referee thinks it is a lion.

A more experienced programmer only insisted on stabbing lions and hoped the lions would die in time. Soon you know that the lion has some fixed parts that damage immunity, and you know that even these parts do not have to be stabbed. Sometimes lions do not expose these parts, so what you really are good at is killing squirrels.

So, to become a great and competitive programmer, you need to be able to do two things.

First, you must learn how to find the fatal weakness of a lion and kill your life.

Second, you must learn how to make your knife more convenient. You must make a sharp wooden stick within one minute and kill the lion with the rest of the minute.

However, you never have enough time to make explosives to deal with lions.

----

Balajiganapathi senthilnathan's Point of View

They are similar to Python and brainfuck [NOTE 1.

In competitive programming, you have to choose the algorithm that you think is feasible first for encoding. The goal of programming is to solve it with at least errors. You don't have to worry about maintaining documents. There is no need to consider how to name variables and cut code into functions. Also, competing programming is short-lived and you don't have to spend a few days on a problem. You are coding most of the time.

Although competitive programming gives you an important understanding of algorithms and how to implement them, you will find in most of your work that programmers are only using algorithm class libraries. Therefore, the most useful part of competitive programming is the algorithm used for the problem at hand. In the workplace, you spend only a few times writing code, most of the time deciding to code, test, document, and ......

Note 1: brainfuck is a minimal computer language created in 1993 by urban Müller. Since fuck is a foul language in English, this language is sometimes called brainf * ck or brainf **, or even BF for short.

Competition programming is different from actual programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.