pleasant专题

B. Pleasant Pairs

time limit per test 2 seconds memory limit per test 256 megabytes You are given an array a1,a2,…,ana1,a2,…,an consisting of nn distinct integers. Count the number of pairs of indices (i,j)(i,j) su