[java]代码库
import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int[] a = new int[num];
int[] b = new int[num];
for(int i = 0; i < a.length; i++)
{
num = scan.nextInt();
a[i] = num;
b[i] = num;
}
scan.close();
Arrays.sort(b);
int big = 0, same = 0, small = 0;
for(int i = 0; i < a.length; i++)
{
if( a[i] > b[i])
big++;
else if(a[i] == b[i])
same++;
else
small++;
}
System.out.println(big);
System.out.println(same);
System.out.println(small);
}
}