#P4670. [BalticOI 2011] Plagiarism (Day2)
[BalticOI 2011] Plagiarism (Day2)
题目描述
The participants of the World Programming Competition submitted solution files to the grading system. Before accepting the results as final, the jury would like to rule out any possibility of plagiarism. They have a program that takes two files and compares them to decide if they are too similar to each other.
However, the number of files is rather big and it would take too much time to compare all pairs. On the other hand, many pairs could be quickly eliminated based on the fact that the file sizes are too different.
More precisely, the jury decided to fully skip comparing every pair where the size of the smaller file is less than 90% of the size of the larger one. So, the comparison program has to examine only those distinct pairs of files where and .
Write a program that computes the number of pairs of files that will have to be examined.
输入格式
The first line of input contains the integer , the number of solution files submitted. The second line contains integers , each showing the size of one file.
输出格式
The first and only line of output must contain one integer, the number of pairs of files that will have to be examined.
2
2 1
0
5
1 1 1 1 1
10
提示
对于 的数据,。
对于所有数据,。