NOIPlus2025 邮寄

· · 生活·游记

NOIPlus2025 邮寄

炸喽!

A

水一波,第六个样例没过,\color{52C41A}100pts

神奇呀。

也不知道为什么、怎么过的,就贴一下代码吧。 :::success[ACcode]

#include<bits/stdc++.h>
using namespace std;
long long n,m,ans;
const int maxn=1e5+5;
long long x[maxn],y[maxn];
int main(){
#ifndef ONLINE_JUDGE
    freopen("candy.in","r",stdin);
    freopen("candy.out","w",stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>x[i]>>y[i];
        y[i]+=x[i];
    }
    sort(x+1,x+1+n);
    sort(y+1,y+1+n);
    int i=1;
    for(;i+1<=n&&y[1]>x[i]+x[i+1]&&m>=x[i]+x[i+1];i+=2)ans+=2,m-=x[i]+x[i+1];
    ans+=2*(m/y[1]);
    m%=y[1];
    ans+=(i<=n&&m>=x[i]);
    cout<<ans;
    return 0;
}

此处不是题解区。 :::

B

不会。\ 沉思。\ 写暴力。\ 暴力枚举情况数做背包。

dying.

沉思 m=2 特殊性质无果。

## C 不会。\ 沉思。\ 写暴力。\ 暴力不会。\ 骗到 $\color{E74C3C}0pts$。 ## D 不会。\ 沉思。\ 写暴力。\ 搞掉 $tc1\sim3$,暴力 ST 表。 特殊性质 AB 好像会又不太会,写了个线段树[^ref1]比暴力慢。\ 炸裂。于是将ST表第二维移至第一维,水掉 $\color{E74C3C}30pts$。 # 总结 $\color{E74C3C}154pts$。 挂了 T4 性质 AB。 [^ref1]: [嗯对线段树](https://www.luogu.com.cn/article/llrxmjpu)