LOADING

加载过慢请开启缓存,浏览器默认开启

daily 1

2023/5/28

CF 1833A

void solve()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++) c[i] = i;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=n;i++) cin>>b[i];

    sort(c+1, c+n+1,[&](int x, int y){
        return a[x]<a[y];
    });
    sort(b+1, b+n+1);
    for(int i=1;i<=n;i++) res[c[i]] = b[i];
    for(int i=1;i<=n;i++) cout<<res[i]<<" ";
    cout<<endl;
}