到底哪个地方错了啊呜呜呜 求助神犇
查看原帖
到底哪个地方错了啊呜呜呜 求助神犇
353114
KeyZhou楼主2020/10/21 12:53

一分没有呜呜呜

第2、8、9、10TLE了 其他都WA了

代码在下面 谢谢各位大佬

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
	int ans=0;
	int n,k,p;
	int judge_kind;
	scanf("%d%d%d",&n,&k,&p);
	int kind[n+1],cost[n+1];
	for(int i=1;i<=n;i++)
		scanf("%d%d",&kind[i],&cost[i]);
	for(int i=1;i<n;i++)
		{
			judge_kind=kind[i];
			if(cost[i]<p) continue;
			  else
			    {
			    	for(int j=i+1;j<=n;j++)
			        if(kind[j]==judge_kind&&cost[j]>=p) ans++;
			    }
		}
		printf("%d",ans);
	return 0;
}
2020/10/21 12:53
加载中...