I wanted to solve ABC172 with Python

Introduction

long time no see. I was so busy with over 100 pages of chemistry homework and math tasks that I couldn't get enough time for a professional competition. I went to ABC for the first time in a long time, but the result was a disastrous defeat. Thank you so much. It was a complete AB.

A problem

Problem

** Thoughts ** Just do

a = int(input())
print(a+a**2+a**3)

B problem

Problem

** Thoughts ** I misread it as a good thing to rearrange the character strings and lost time. Just check in order from the front

s = input()
t = input()

ans = 0
for i in range(len(s)):
    if s[i] != t[i]:
        ans += 1

print(ans)

C problem

Problem

** Thoughts ** It seems to be solved with DP. knapsack-I thought it could be solved if I paid attention to the memory like DP.

D problem

Problem

** Thoughts ** I don't know how to quickly enumerate the number of divisors. I didn't know how to reduce from $ O (N \ sqrt N) $.

Summary

Even if I haven't done it for a while, the decline is noticeable and I am surprised myself. Now that the assignments have been completed, I will do my best.

Recommended Posts

I wanted to solve ABC160 with Python
I wanted to solve ABC172 with Python
I wanted to solve NOMURA Contest 2020 with Python
I wanted to solve the ABC164 A ~ D problem with Python
I wanted to solve the Panasonic Programming Contest 2020 with Python
Solve AtCoder ABC166 with python
I wanted to install Python 3.4.3 with Homebrew + pyenv
I want to solve APG4b with Python (Chapter 2)
Solve AtCoder ABC 186 with Python
I tried to solve the soma cube with python
I tried to solve the problem with Python Vol.1
I tried to solve AOJ's number theory with Python
Solve ABC163 A ~ C with Python
Solve ABC166 A ~ D with Python
Solve ABC168 A ~ C with Python
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
Solve ABC158 A ~ C with Python
I want to debug with Python
I want to analyze logs with Python
I want to play with aws with python
[AtCoder] Solve ABC1 ~ 100 A problem with Python
Solve AtCoder ABC168 with python (A ~ D)
I tried to solve TSP with QAOA
I really wanted to copy with selenium
I tried to solve the ant book beginner's edition with python
I want to solve APG4b with Python (only 4.01 and 4.04 in Chapter 4)
Solve AtCoder 167 with python
Solve Sudoku with Python
Solve ABC169 in Python
Solve POJ 2386 with python
[AtCoder] Solve A problem of ABC101 ~ 169 with Python
I want to use MATLAB feval with python
Try to solve the man-machine chart with Python
I want to make a game with Python
I tried to get CloudWatch data with Python
I tried to output LLVM IR with Python
I want to use Temporary Directory with Python2
I tried to automate sushi making with python
#Unresolved I want to compile gobject-introspection with Python3
I want to write to a file with Python
How to write offline real time I tried to solve E11 with python
It's more recent, but I wanted to do BMI calculation with python.
How to write offline real time I tried to solve E12 with python
[Python] Solve equations with sympy
I tried fp-growth with python
I tried scraping with Python
Try to solve the programming challenge book with python3
I also wanted to check type hints with numpy
ABC163 C problem with python3
I want to handle optimization with python and cplex
I tried to implement Minesweeper on terminal with python
I tried to get started with blender python script_Part 01
Try to solve the internship assignment problem with Python
I tried to touch the CSV file with Python
Connect to Wikipedia with Python
I tried to draw a route map with Python
Post to slack with Python 3
Solve ABC176 E in Python
I wanted to use the Python library from MATLAB
I want to solve Sudoku (Sudoku)