Help us understand the problem. What is going on with this article?

# Atcoder Beginner Contest152のきろく（python）

## 1

```N , M = map(int,input().split())
if N == M:
print("Yes")
else:
print("No")
```

## 2

その為、smallの値をlargeの回数繰り返せば良い

```a, b = map(int,input().split())
ans = str(min(a, b)) * max(a, b)
print(ans)
```

## 3

chokudaiさんも解けてほしいと言っていた問題。

その為、左から値を保持し、常に最小であるか判定すれば\$O(N)\$で解ける。

```N = int(input())
P = list(map(int, input().split()))
now = P[0]
ans = 1
for i in range(1, N):
if now >= P[i]:
now = P[i]
ans += 1
print(ans)
```

## 4

この問題のポイントは値を1〜9までしか使わない為、9*9の二次元配列を作る。それをforでカウントし、2数の組合せが答えとなる。

```from pprint import pprint
N = int(input())
digit_cnt = list([0] * 9 for _ in range(9))
now = 1
for i in range(1, N + 1):
str_i = str(i)
row = int(str_i[0])
column = int(str_i[-1])
if row != 0 and column != 0:
digit_cnt[row - 1][column - 1] += 1
# pprint(digit_cnt)

ans = 0
for i in range(9):
for j in range(9):
ans += digit_cnt[i][j] * digit_cnt[j][i]
print(ans)
```
Why not register and get more from Qiita?
1. We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
2. you can read useful information later efficiently
By "stocking" the articles you like, you can search right away