0101少儿编程
Home
ProblemSet
Source/Category
Contest
Status
Ranklist
F.A.Qs
IDE下载
Login
Register
6463: FZ-2.4 找相同数对
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:34
Solved:4
Submit
Submit Record
Statistics
ShowOff!
Description
给出一串数以及一个数字C,要求计算出所有A-B=C的数对的个数(不同位置的数字一样的数对算不同的数对)。
Input
共两行。
第一行输入两个整数n和c;
第二行输入n个整数,作为要求处理的那串数。
Output
该串数中包含的满足A-B=C的数对的个数。
Sample Input
Copy
6 3 8 4 5 7 7 4
Sample Output
Copy
5
HINT
数据范围:
1 <= n <= 2 * 10
5
所有输入数据的绝对值小于 2
30
Source/Category
算法竞赛
双指针
Submit
Submit Record
Statistics
ShowOff!