問題一覧 > 通常問題

No.1844 Divisors Sum Sum

レベル : / AI推定難易度 : 1300 / 実行時間制限 : 1ケース 3.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 133
作問者 : 👑 potato167 / テスター : tatyam ramdos
お気に入りにしたユーザー ProblemId : 6887 / 自分の提出
問題文最終更新日: 2025-02-08 00:12:05
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 332 (順位表) の他の問題:

Problem Statement

Consider the following problem $X$.

Problem $X$

For a given integer, find the sum of the positive divisors of that integer.

You are given integer sequences $P$ and $e$ of length $L$. The elements of $P$ are distinct prime numbers. Here, let $N=\prod_{i=1}^{L} P_i^{e_i}$ $(= P_1^{e_1}\times P_2^{e_2}\times \dots \times P_L^{e_L})$.

For every positive divisor of $N$, find the answer to problem $X$ when given that number, and output the sum of these answers. Since the answer can be very large, output the remainder when divided by $(10^{9}+7)$.

Constraints

  • $1\leq L\leq 2\times10^{5}$
  • $1\leq P_i,e_i\leq 10^{9}$
  • All inputs are integers
  • All $P_i$ are prime numbers
  • If $i\neq j$, then $P_i\neq P_j\;(1\leq i,j\leq L)$

Input

$L$
$P_1\; e_1$
$P_2\; e_2$
$\vdots$
$P_L\; e_L$

Output

Output the remainder when the answer is divided by $(10^{9}+7)$. Print a newline at the end.

Sample

Sample 1
Input
2
2 2
3 1
Output
55

$N=2^{2}\times3^{1}=12$, and $12$ has $6$ divisors: $1,2,3,4,6,12$.

  • Sum of the divisors of $1$ : $1=1$
  • Sum of the divisors of $2$ : $1+2=3$
  • Sum of the divisors of $3$ : $1+3=4$
  • Sum of the divisors of $4$ : $1+2+4=7$
  • Sum of the divisors of $6$ : $1+2+3+6=12$
  • Sum of the divisors of $12$ : $1+2+3+4+6+12=28$

Therefore, the value to output is $1+3+4+7+12+28=55$.

Sample 2
Input
1
167 1
Output
169
Sample 3
Input
10
914260891 350096548
887686339 192497607
786328273 878092875
735623069 355760739
129154631 798229587
427094807 82130028
520933789 204087959
641996039 29097051
278883373 321445979
447005677 226153917
Output
326821356

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。