正文
增加 5 行删除 5 行
5 行未改动678910111213148 行未改动2324252627282930313233343536373824 行未改动6364656667686970717273185 行未改动全部展开5 行未改动```cpp#include<bits/stdc++.h>#define int long long#define MN 100010using namespace std;const int inf=1ll<<60;8 行未改动if(f[x-d[a[i]]]==inf) continue;if(f[x-d[a[i]]]+1>f[x]||f[x]==-1)f[x]=f[x-d[a[i]]]+1, g[x]=a[i];else if(f[x-d[a[i]]]+1==f[x]&&a[i]>g[x])g[x]=a[i];}if(f[x]==-1) f[x]=inf;}void print(int x) {if(x<=0) return;cout << g[x];print(x-d[g[x]]);}signed main() {24 行未改动那不是拓欧板子?注意到会爆 longlong /fad$a,b$ 很小但是其它很大,然后因为尽量小的约束 $y$ 也是范围很小。所以我们枚举 $y$ 去算就行了(((```cpp#include<bits/stdc++.h>#define int long long185 行未改动全部展开5 行未改动678910111213148 行未改动2324252627282930313233343536373824 行未改动6364656667686970717273185 行未改动全部展开5 行未改动```cpp#include<bits/stdc++.h>#define int long long#define MN 100010using namespace std;const int inf=1ll<<60;8 行未改动if(f[x-d[a[i]]]==inf) continue;if(f[x-d[a[i]]]+1>f[x]||f[x]==-1)f[x]=f[x-d[a[i]]]+1, g[x]=a[i];else if(f[x-d[a[i]]]+1==f[x]&&a[i]>g[x])g[x]=a[i];}if(f[x]==-1) f[x]=inf;}void print(int x) {if(x<=0) return;cout << g[x];print(x-d[g[x]]);}signed main() {24 行未改动那不是拓欧板子?注意到会爆 longlong /fad$a,b$ 很小但是其它很大,然后因为尽量小的约束 $y$ 也是范围很小。所以我们枚举 $y$ 去算就行了(((```cpp#include<bits/stdc++.h>#define int long long185 行未改动全部展开