超时求调
查看原帖
超时求调
1064250
Big_Smart楼主2024/10/5 15:37
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int a[N]; 
int main()
{
	int n, c = 0;
	cin >> n;
	for(int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	sort(a, a + n);
	
	for(int i = 1; i <= n; i++)
	{
		for(int j = 1; j <= n; j++)
		{
			if(a[j] > a[i] && a[j] != a[i])
			{
				c++;
			} 
		} 
	}
	
	cout << c;
	return 0;
}
2024/10/5 15:37
加载中...