问题

### Instructions: You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
### Question:
AtCoder Kingdom uses a calendar whose year has N months.
Month i (1\leq i\leq N) has D _ i days, from day 1 of month i to day D _ i of month i.
How many days in a year of AtCoder have "repdigits" dates?
Here, day j of month i (1\leq i\leq N,1\leq j\leq D _ i) is said to have a repdigit date if and only if all digits in the decimal notations of i and j are the same.

Input

The input is given from Standard Input in the following format:
N
D _ 1 D _ 2 \ldots D _ N

Output

Print the answer.

Constraints


- 1\leq N\leq100
- 1\leq D _ i\leq100\ (1\leq i\leq N)
- All input values are integers.

Sample Input 1

12
31 29 31 30 31 30 31 31 30 31 30 31

Sample Output 1

13

In AtCoder Kingdom, the days that have repdigit dates are January 1, January 11, February 2, February 22, March 3, April 4, May 5, June 6, July 7, August 8, September 9, November 1, and November 11, for a total of 13 days.

Sample Input 2

10
10 1 2 3 4 5 6 7 8 100

Sample Output 2

1

In AtCoder Kingdom, only January 1 has a repdigit date.

Sample Input 3

30
73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32

Sample Output 3

15

### Format: Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows.
```python
# YOUR CODE HERE
```

### Answer: (use the provided format with backticks)

答案

模型 模型答案 正确答案
金声玉亮2.0 ```python
def is_repdigit(num):
return len(set(str(num))) == 1

def count_repdigit_dates(N, D):
count = 0
for month in range(1, N + 1):
if is_repdigit(month):
for day in range(1, D[month - 1] + 1):
if is_repdigit(day) and str(month)[0] == str(day)[0]:
count += 1
return count

# Read input
N = int(input())
D = list(map(int, input().split()))

# Calculate and print the answer
print(count_repdigit_dates(N, D))
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
deepseek-r1

```python
def is_repdigit(n):
s = str(n)
return all(c == s[0] for c in s)

n = int(input())
d_list = list(map(int, input().split()))
count = 0

for month in range(1, n+1):
if not is_repdigit(month):
continue
digit = str(month)[0]
days = d_list[month - 1]
for day in range(1, days + 1):
s_day = str(day)
if all(c == digit for c in s_day):
count += 1

print(count)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
gpto1 ```python
# YOUR CODE HERE
N = int(input())
D = list(map(int, input().split()))
rep_digits = []

for digit in range(1,10):
# 1-digit repdigit
rep_digits.append(digit)
# 2-digit repdigit
double_digit = int(str(digit)*2)
if double_digit <= 100:
rep_digits.append(double_digit)

count = 0

for i in range(1,N+1):
if i in rep_digits:
D_i = D[i-1]
for j in rep_digits:
if 1 <= j <= D_i:
count +=1

print(count)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
gpt-4o-2024-08-06 ```python
# YOUR CODE HERE
def is_repdigit(number):
"""Check if all digits in the number are the same."""
str_num = str(number)
return all(digit == str_num[0] for digit in str_num)

def count_repdigit_days(N, days_in_months):
repdigit_days_count = 0

for month in range(1, N + 1):
for day in range(1, days_in_months[month - 1] + 1):
if is_repdigit(month) and is_repdigit(day):
repdigit_days_count += 1

return repdigit_days_count

import sys
input = sys.stdin.read
data = input().split()

N = int(data[0])
days_in_months = list(map(int, data[1:]))

result = count_repdigit_days(N, days_in_months)
print(result)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
DeepSeek-Coder-V2-Lite-Instruct ```python
# YOUR CODE HERE
def count_repdigit_dates(N, D):
count = 0
for i in range(1, N + 1):
for j in range(1, D[i - 1] + 1):
if all(digit == str(i)[0] for digit in str(i)) and all(digit == str(j)[0] for digit in str(j)):
count += 1
return count

# Read input
import sys
input = sys.stdin.read
data = input().split()

N = int(data[0])
D = list(map(int, data[1:]))

# Solve the problem
result = count_repdigit_dates(N, D)

# Output the result
print(result)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
Meta-Llama-3.1-405B-Instruct-Turbo ```python
import sys

def is_repdigit(num):
num_str = str(num)
return len(set(num_str)) == 1

N = int(input())
D = list(map(int, input().split()))

count = 0
for i in range(N):
for j in range(1, D[i] + 1):
if is_repdigit(i + 1) and is_repdigit(j):
count += 1

print(count)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
Meta-Llama-3.1-70B-Instruct-Turbo ```python
import sys

n = int(input())
days = list(map(int, input().split()))

count = 0
for i in range(n):
for j in range(1, days[i] + 1):
str_i = str(i + 1)
str_j = str(j)
if len(str_i) == len(str_j) and all(c == str_i[0] for c in str_i) and all(c == str_j[0] for c in str_j):
count += 1

print(count)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
Qwen2-72B-Instruct ```python
N = int(input())
D = list(map(int, input().split()))

ans = 0
for i in range(1, N + 1):
if 10 > i:
if 10 > D[i - 1]:
ans += 1
for j in range(10, min(100, D[i - 1] + 1), 11):
if j // 10 == i:
ans += 1
else:
for j in range(10, min(100, D[i - 1] + 1), 11):
if j // 10 == i:
ans += 1
print(ans)
```
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
baichuan4 ```python
# YOUR CODE HERE
import sys

# Read input from stdin
input_data = sys.stdin.read().strip().split()

# Parse the number of months and days in each month
N = int(input_data[0])
days_in_month = list(map(int, input_data[1:]))

# Function to check if a number is a repdigit
def is_repdigit(num):
return num == int(str(num)[0] * len(str(num)))

# Count the number of repdigit dates
repdigit_count = 0
for month, days in enumerate(days_in_month, start=1):
for day in range(1, days + 1):
if is_repdigit(month) and is_repdigit(day):
repdigit_count += 1

# Print the answer to stdout
print(repdigit_count)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
doubao ```python
N = int(input())
D = list(map(int, input().split()))

count = 0
for i in range(1, N + 1):
for j in range(1, D[i - 1] + 1):
if str(i) == str(j):
count += 1

print(count)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
gpto1 ```python
# YOUR CODE HERE
N = int(input())
D = list(map(int, input().split()))
rep_digits = []

for digit in range(1,10):
# 1-digit repdigit
rep_digits.append(digit)
# 2-digit repdigit
double_digit = int(str(digit)*2)
if double_digit <= 100:
rep_digits.append(double_digit)

count = 0

for i in range(1,N+1):
if i in rep_digits:
D_i = D[i-1]
for j in rep_digits:
if 1 <= j <= D_i:
count +=1

print(count)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
kimi ```python
# YOUR CODE HERE
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
for j in range(1, d[i - 1] + 1):
ij = str(i) + str(j)
if len(set(ij)) == 1:
ans += 1
print(ans)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
minimax ```python
# YOUR CODE HERE
def is_repdigit(date):
return str(date).isdigit() and len(set(str(date))) == 1

def count_repdigit_dates(N, D):
repdigit_count = 0
for month in range(1, N + 1):
for day in range(1, D[month - 1] + 1):
if is_repdigit(month) and is_repdigit(day):
repdigit_count += 1
return repdigit_count

# Read the inputs from stdin
N = int(input())
D = list(map(int, input().split()))

# Solve the problem and write the answer to stdout
print(count_repdigit_dates(N, D))
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
wenxinyiyan ```python
def count_repdigit_dates(N, D):
count = 0
for i in range(1, N+1):
digit = str(i)
for j in range(1, D[i-1]+1):
if all(d == digit[0] for d in str(j)):
count += 1
return count

N = int(input())
D = list(map(int, input().split()))

print(count_repdigit_dates(N, D))
```
This Python program defines a function `count_repdigit_dates` that takes two arguments: `N` (the number of months in a year) and `D` (a list of the number of days in each month). The function iterates over each month and day, checking if the day has a "repdigit" date by comparing all digits in the day number to the first digit in the month number. If they are all the same, the count is incremented. Finally, the function returns the total count of repdigit dates.

The program reads the input values `N` and `D` from standard input, calls the `count_repdigit_dates` function with these values, and prints the result to standard output.
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
zhipu ```python
def main():
import sys
input = sys.stdin.read
data = input().split()

N = int(data[0])
D = list(map(int, data[1:]))

repdigit_days_count = 0

for month in range(1, N + 1):
for day in range(1, D[month - 1] + 1):
if str(month).count(str(month)[0]) == len(str(month)) and str(day).count(str(day)[0]) == len(str(day)):
repdigit_days_count += 1

print(repdigit_days_count)

if __name__ == "__main__":
main()
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]
deepseek-v3 ```python
# YOUR CODE HERE
def count_repdigit_days(N, Ds):
count = 0
for i in range(1, N+1):
month_str = str(i)
if len(set(month_str)) == 1:
# Month is a repdigit
for j in range(1, Ds[i-1]+1):
day_str = str(j)
if len(set(day_str)) == 1:
# Day is a repdigit
count += 1
else:
# Month is not a repdigit, but we still need to check if the day is a repdigit and matches the month's digit
month_digit = month_str[0]
if all(c == month_digit for c in month_str):
for j in range(1, Ds[i-1]+1):
day_str = str(j)
if all(c == month_digit for c in day_str):
count += 1
return count

# Read input
N = int(input())
Ds = list(map(int, input().split()))

# Compute and print the result
result = count_repdigit_days(N, Ds)
print(result)
```
[{"input": "12\n31 29 31 30 31 30 31 31 30 31 30 31\n", "output": "13\n", "testtype": "stdin"}, {"input": "10\n10 1 2 3 4 5 6 7 8 100\n", "output": "1\n", "testtype": "stdin"}, {"input": "30\n73 8 55 26 97 48 37 47 35 55 5 17 62 2 60 23 99 73 34 75 7 46 82 84 29 41 32 31 52 32\n", "output": "15\n", "testtype": "stdin"}]