题意,给你n条边,问你能同时组成多少个平行四边形。
两条相同的边为一组,如果有sum组,那么就能组成sum/2个平行四边形
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <map>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <ctime>
#include <stack>
#define MM 46400
using namespace std;
typedef long long ll;
int main()
{
int n,a[200010];
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
sort(a+1,a+1+n);
int cnt=0;
for(int i=1;i<=n;i++)
{
if(a[i]==a[i+1])
{
i++;
cnt++;
}
}
printf("%d\n",cnt/2);
return 0;
}