#4849. Measure

0
    ID: 4849 传统题 2000ms 1024MiB 尝试: 0 已通过: 0 难度: 2 上传者: 标签>AtCoderabc319BGESP 3级枚举(双层循环)字符串

Measure

Measure

题目描述

You are given a positive integer NN. Print a string of length (N+1)(N+1), s0s1…sNs_0s_1\ldots s_N, defined as follows.

For each $i = 0, 1, 2, \ldots, N$,

if there is a divisor jj of NN that is between 11 and 99, inclusive, and ii is a multiple of N/jN/j, then sis_i is the digit corresponding to the smallest such jj (sis_i will thus be one of 11, 22, ..., 99); if no such jj exists, then sis_i is −-.

输入格式

The input is given from Standard Input in the following format: NN

输出格式

Print the answer.

12
1-643-2-346-1
7
17777771
1
11

提示

1≤N≤10001 \leq N \leq 1000 All input values are integers.We will explain how to determine sis_i for some ii.

For i=0i = 0, the divisors jj of NN between 11 and 99 such that ii is a multiple of N/jN/j are 1,2,3,4,61, 2, 3, 4, 6. The smallest of these is 11, so s0=s_0 = 11.

For i=4i = 4, the divisors jj of NN between 11 and 99 such that ii is a multiple of N/jN/j are 3,63, 6. The smallest of these is 33, so s4=s_4 = 33.

For i=11i = 11, there are no divisors jj of NN between 11 and 99 such that ii is a multiple of N/jN/j, so s11=s_{11} = −-.

标签: AtCoder|abc319B

来源

AtCoder|abc319B