AcWing
  • 首页
  • 活动
  • 题库
  • 竞赛
  • 商店
  • 应用
  • 文章
    • 题解
    • 分享
    • 问答
  • 吐槽
  • 登录/注册

AcWing 101. 最高的牛

作者: 作者的头像   忘了爱 ,  2022-08-06 09:00:15 ,  所有人可见 ,  阅读 2


0


手牵手一步两步三步四步望着天
看星星一颗两颗三颗四颗连成线
背对背默默许下心愿
看远方的星是否听得见
它一定实现

#include <iostream>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
map<pair <int,int> ,bool > exist;
int n,p,h,m,c[10005],d[10005];
int main()
{
    cin>>n>>p>>h>>m;
    for(int i=1;i<=m;i++)
    {
        int a,b;
        cin>>a>>b;
        if(a>b)swap(a,b);
        if(exist[make_pair(a,b)])continue;
        d[a+1]--;
        d[b]++;
        exist[make_pair(a,b)]=true;
    }
    for(int i=1;i<=n;i++)
    {
        c[i]=c[i-1]+d[i];
        cout<<h+c[i]<<endl;
    }

}

0 评论

你确定删除吗?
1024
x

© 2018-2022 AcWing 版权所有  |  京ICP备17053197号-1
用户协议  |  常见问题  |  联系我们
AcWing
请输入登录信息
更多登录方式: 微信图标 qq图标
请输入绑定的邮箱地址
请输入注册信息