A story that turned light blue in 4 months after starting AtCoder with python

It is an article according to the title. 無題.png I started AtCoder in September and it turned light blue at AGC41 the other day. I thought I would summarize what I have done so far in this area, so I will write it as an article. I don't know if it will be helpful to everyone.

About the person who writes

――I have taken the junior high school exam and graduated from the former imperial university graduate school (chemistry major). Therefore, I have the mathematical background to enroll in them. I had a lot of fun at college, so I don't remember college mathematics. ――Business is IT-related, but I rarely program because it is closer to infrastructure. --Java was touched about a year ago for about two months. I've touched C ++ a little long ago. So I'm not a complete layman about programming. --Examples of what you knew before you started AtCoder - if, for, while --Array --Standard input / output - VSCode --Examples of things you didn't know until you started AtCoder --python grammar --Concept of computational complexity --Recursive function --DFS / BFS

You can solve the ABC B problem without much hesitation, but start from a state where you have almost no knowledge of competitive programming and algorithms. AtCoder started out as a hobby.

What i did

** Solve problems with just the right level of difficulty with Atcoder Problems. **only this. ↓ This is the current ABC filling status. 無題.png Well, I'm asking 330 questions in 4 months, so I think it's a person who packed it in a short period of time, but if you think of it as light blue after doing 330 questions, isn't it appropriate? Impression that. Recently, I've been filling up the contest a little, so there are fewer problems that I actually learned.

――If there is something you don't understand or a method you don't know, google it ad hoc. Since the explanation of AtCoder contains algorithms and methods that are keywords, try implementing it yourself while searching for implementation examples with "(keyword) python". If you want to use what you made, make it into a library. The current situation is like this.

無題.png By the way, ** I haven't used mathpy or scipy yet. ** ** You can do it without using it at all. I plan to use it in the future.

――Filling in too low difficulty may be good for maintaining motivation, but I think it is useless (not meaningless) for improving. A person who can solve problem A in 4 minutes can only earn 2 minutes even if he doubles the speed, but if problem D takes 40 minutes, he can earn 4 minutes just by speeding it up by 10%, so it is a difficult problem. I think that it is easier to improve if you work on. Also, from experience, even if you solve 10 questions of 300 points, you will not be able to solve 400 points. If you can solve 400 points, you have to challenge 10 questions to 400 points. ―― ** It is a truth that has been verified in all fields that it is best for growth to continue to take on challenges that are about 1.1 times your own ability. ** At Coder, the conclusion so far is that it is best to tackle the "problem of whether you can solve it in about an hour".

――Think about the problem until you understand it completely. Even if you look at the commentary and think, "Oh, I see," don't stop there. I will do it until I implement it properly with my own hands. The same was true for studying for entrance exams, but ** The most dangerous thing is that you can solve it by accumulating as many questions as you can and moving your hands by stopping thinking. ** I will do it with the intention of making each question my own blood. However, there are some things that I still think "I'm still early" when I look at the commentary, so I don't overdo it. --See other people's answers submitted in python. It's often too advanced to be helpful, but I often come across things I didn't know. ――I bought an ant book and read about half of it. I try to read it when I feel a sense of stagnation. It is important to read a comprehensively written book. Of course, you can't write code just by reading.

Advantages and disadvantages of python

--Algorithmic power does not depend on language --Implementation power depends on language experience, not language selection ――Every language has advantages and disadvantages --Learning costs are overwhelmingly lower for the second and subsequent languages than for the first language

That's a major premise, and on top of that, I'll list the merits that I actually felt using python.

○ Readability is relatively high

It's easy to understand what you're doing at a glance ... I feel. This is more of an advantage when you look at someone else's code than it is for you to use it. To be honest, I feel that it doesn't matter whether I write it a little confusingly or with a lot of parentheses. Modern major languages may not be as good or bad as they are (because they are otherwise eliminated). On the other hand, when reading someone else's code, I often find python to be advantageous because it is short and neat. Well this is also subjective.

○ Many methods have been implemented

There are many people who wondered, "Is this there?" Binary search, priority queue, permutation, etc. And if you google, it basically comes out. There are various shortest path methods (although it is better to have one that you have implemented yourself so that you can make various minor modifications).

△ Need to study the method

Of course, you can't use something you don't know. You don't have a chance to know until you run into the problem of using that method. Well, all you have to do is study.

△ Knowledge of the amount of calculation for each method is required

I think that it is common to all languages to some extent, but the speed changes completely depending on the method used even with the same implementation content. Especially around the text operation, the difference is bigger. However, I think that the big difference is the flip side of the abundance of methods. It can be said that it is a big merit that you do not have to implement detailed methods by yourself.

× You need to select pypy and python

Basically, you can use pypy, but python is faster only for recursive functions. If you are in a hurry during the contest, you may forget your choice and TLE (one loss).

?? Execution speed is not fast

However, I have never had a python competition professional life so far that "TLE remains, but there is no room for scraping anymore". [Here](https://maspypy.com/atcoder-%E6%A9%992400%E3%81%AB%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%97 It is also written in% E3% 81% 9F), but I think that it will not be a problem unless it is at a level that turns yellow or orange. I think python should be stopped if you are confident that you can turn yellow in such a short time that you do not have time to change the language, but how many people are there in the world ... Also, I personally have a little doubt about the opinion that "improvement by a constant factor is not essential", and as long as I compete with the code I actually wrote, I devised a way of writing so that it fits within the time limit by suppressing the characteristics of the language. Isn't it natural to do it? I think. Even if the logic is correct, I think that it should be incorrect if the execution speed is slow.

What I think about doing AtCoder

Simple and fun

Since I have solved a lot of problems by studying for entrance exams for a long time, the reward system for solving the problems has been completed. Waiting for the judge, the brain juice when the AC display appears is still a great motivation to continue AtCoder.

Code quality doesn't improve much

Especially within the limited time of the contest, it is easy to copy and paste almost the same process over and over, and to increase the number of cases more than necessary. I don't think that the skill of writing clean code is very good unless you are aware of it.

Not very useful in practice

Of course, it may be useful depending on the type of business, but at my company, the connection with the DB / front and the framework are more important, so I don't feel that it is very useful in practice. Well, I think that's the case. I feel like I'm just doing it as a hobby.

Future goals

There are so many things I haven't studied yet, so I want to continue to increase what I can do and go as far as I can. Isn't it something that goes up to blue? I feel that.

that's all. If you have any idea, I will add it.

Recommended Posts

A story that turned light blue in 4 months after starting AtCoder with python
Light blue with AtCoder @Python
It turned blue after 9 months of Atcoder history (python)
A story that went missing when I specified a path starting with a tilde (~) in python open
Let's create a script that registers with Ideone.com in Python.
The story of making a module that skips mail with python
A story that didn't work when I tried to log in with the Python requests module
The story of creating a bot that displays active members in a specific channel of slack with python
[Python] A program that creates stairs with #
Dealing with "years and months" in Python
[AtCoder] Solve ABC1 ~ 100 A problem with Python
[DSU Edition] AtCoder Library reading with a green coder ~ Implementation in Python ~
Solve AtCoder ABC168 with python (A ~ D)
A reminder of what I got stuck when starting Atcoder with python
A typed world that begins with Python
"First Elasticsearch" starting with a python client
Until it turns light blue with AtCoder
Word count that counts only words that start with a capital letter in python
A confusing story with two ways to implement XGBoost in Python + overall notes
I registered PyQCheck, a library that can perform QuickCheck with Python, in PyPI.
I made a familiar function that can be used in statistics with Python
A story that I was addicted to when I made SFTP communication with python
[Python] Get the files in a folder with Python
A memo that I wrote a quicksort in Python
[Python3] A story stuck with time zone conversion
Create a virtual environment with conda in Python
Create a page that loads infinitely with python
A program that removes duplicate statements in Python
A story stuck with handling Python binary data
Work in a virtual environment with Python virtualenv.
Create a new page in confluence with Python
A story packed with absolute values in numpy.ndarray
Challenge AtCoder (ABC) 164 with Python! A ~ C problem
Formulas that appear in Doing Math with Python
[Fenwick_Tree] AtCoder Library-Reading with Green Coder-Implementation in Python-
The story that fits in with pip installation
Create an exe file that works in a Windows environment without Python with PyInstaller
[Python] Leave only the elements that start with a specific character string in the array
How to convert / restore a string with [] in python
A story about making 3D space recognition with Python
Playing with a user-local artificial intelligence API in Python
Make a simple Slackbot with interactive button in python
Try embedding Python in a C ++ program with pybind11
Use Cursur that closes automatically with sqlite3 in Python
Python knowledge notes that can be used with AtCoder
A story that struggled with the common set HTTP_PROXY = ~
A story about making Hanon-like sheet music with Python
A story about trying a (Golang +) Python monorepo with Bazel
I want to work with a robot in python.
What's in that variable (when running a Python script)
In Python, create a decorator that dynamically accepts arguments Create a decorator
A addictive point in "Bayesian inference experience with Python"
A server that echoes data POSTed with flask / python
A memo that I touched the Datastore with python
Solve Atcoder ABC176 (A, B, C, E) in Python
Run a Python file with relative import in PyCharm
A story that stopped my heart after upgrading OpenStack
Create a fake Minecraft server in Python with Quarry
A story that I wanted to do a function like before_action used in rails with django [Beginner learns python with a reference book]
MALSS, a tool that supports machine learning in Python
Can be used with AtCoder! A collection of techniques for drawing short code in Python!