Sum
시간 제한: 1000ms메모리 제한: 1024MB출처: EIO 2018-19 prelimBOJ 29940
문제
Consider an -element strictly increasing integer sequence and an integer .
Write a program to count the number of pairs of elements of whose sum is .
입력
The first line of input contains and , the length of the sequence and the required sum (, ). The following lines contain elements of the sequence, one element () on each line. The elements are distinct and ordered increasingly.
출력
The only line of output should contain the number of pairs that consist of two distinct elemets of the sequence and sum to .
예제
예제 1
입력
5 10 1 3 5 7 9
출력
2
코드를 제출하려면 로그인하세요.