您当前的位置: 首页 >  ar

钟钟终

暂无认证

  • 0浏览

    0关注

    233博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

8/14 思维+经典dp基础+tarjan算法

钟钟终 发布时间:2022-08-15 02:15:31 ,浏览量:0

D. Empty Graph

题意可转化为给定一个数组,选定一个区间,两点之间的连线为[l,r]中的最小值,问在这些边中最大值是多少 思路:这次D题想的方向是对的,但有些情况没有考虑到。别人用二分写的,这我就有点迷惑了,属实没往这个方向想。 1.正常情况下m==0 不修改,则max(ans,min(a[i],a[i+1])) 2.a数组中前k小的数都会被修改,则max(ans,max(a[i],a[i+1])) 3.一种情况要特判。数组:2 4 4 9 ,若k=2,则a[2]=a[3]=b[2],这种情况则比较b[m]*2和9

#include
#define endl '\n'
#define re register
#define int long long
#define ios (ios::sync_with_stdio(false),cin.tie(0),cout.tie(0))
#define maxn 1000000000LL
using namespace std;
const int N=2e5+10;
const int inf=0x3f3f3f3f;
const int mod=1e7+7;
int n,m,a[N],b[N],ans;

void solve()
{
    cin>>n>>m;
    for(int i=1;i>a[i],b[i]=a[i];
    ans=0;
    if(m==n)
    {
        ans=maxn;
        cout            
关注
打赏
1664378814
查看更多评论
0.0404s