#A1021. 两数之模
两数之模
Description
给定数组 和正整数 ,统计数组中有多少对不同的,使得,输出答案对取模
运算是两数相除的余数
Format
Input
第一行两个整数
第二行 个整数,表示给定数组
Output
一行一个整数
Samples
输入
3 1
1 2 3
输出
3
Limitation
Related
In following contests:
给定数组 n 和正整数 k,统计数组中有多少对不同的i,j,使得aimodaj=k,输出答案对998244353取模
mod 运算是两数相除的余数
第一行两个整数n,k
第二行 n 个整数,表示给定数组
一行一个整数
输入
3 1
1 2 3
输出
3
1≤n≤105,0≤ai,k≤106
In following contests:
By signing up a 龙樾实验中学 universal account, you can submit code and join discussions in all online judging services provided by us.