0分求改(玄关)
查看原帖
0分求改(玄关)
1128458
Goodans楼主2024/10/8 15:17
#include<bits/stdc++.h>
using namespace std;
#define dy signed long long 
#define sr cin>> 
#define sc cout<< 
dy n,k,p,y,b[102][2],x,ans;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
//	freopen("hotel.in","r",stdin);
//	freopen("hotel.out","w",stdout);
	sr n>>k>>p;
	for(dy i=1;i<=n;i++){
		sr x>>y;
		if(y<=p) b[x][1]++;
		else b[x][2]++;
	} 
	for(dy i=0;i<=100;i++){if((b[i][1]==1&&b[i][2]>=1)||b[i][1]>1){ans+=b[i][1]*(b[i][1]-1)/2+b[i][2]*b[i][1];}}
	sc ans;
	return 0;
}
/*
5 2 10
0 11
1 5
0 12
0 6
1 11
*/

都wa了

2024/10/8 15:17
加载中...