#include
#include
#include
using namespace std;
//定义变量
int n, m, b[5005], s[5005];
int main()
{
{
//读入
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
{
scanf("%d%d", &b[i], &s[i]);
}
//2.排序
for (int i = 1; i <= n; i++)
{
for (int j = i + 1; j <= n; j++)
{
if(s[j]>s[i]||(s[j]==s[i]&&b[j]=s[m])
{
cnt++;
}
}
printf("%d\n", cnt);
for (int i = 1; i <= cnt; i++)
{
cout<
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)