C Archive

Codeforces Round #429 (Div. 2), problem: (C) Leha and Function Solution In C/C++

Codeforces Round #429 (Div. 2), problem: (C) Leha and Function Solution In C/C++

#include<bits/stdc++.h> using namespace std; int main(){ std::ios::sync_with_stdio(false); int m; cin>>m; int a,b; for(int i=0;i<m;i++) cin>>a; vector<pair<int,int> >br(m); for(int i=0;i<m;i++){ cin>>b; br=make_pair(b,i); } sort(a,a+m); int ans; sort(br.begin(),br.end()); reverse(br.begin(),br.end()); for(int i=0;i<m;i++) ans.second]=a; for(int i=0;i<m;i++) cout<<ans<<” “; return …