import java.io.*;
import java.util.StringTokenizer;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
StringTokenizer tokenizer2 = new StringTokenizer(reader.readLine());
int n = Integer.parseInt(tokenizer.nextToken());
int m = Integer.parseInt(tokenizer.nextToken());
int[] nums = new int[n];
for(int i=0;i<n;i++)nums[i]=Integer.parseInt(tokenizer2.nextToken());
int count=0;
for(int i=0;i<n-1;i++)
for(int j=i+1;j<n;j++)
if(nums[i]+nums[j]==m)count++;
System.out.print(count);
}
}
做到现在都觉得这比赛题特别简单,也就课后习题的难度,属实是没有含金量是吧
也不知道今年难度会不会水涨船高