We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e60dc2 commit daeb81fCopy full SHA for daeb81f
1833B - Restore the Weather.cpp
@@ -0,0 +1,43 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int main()
10
+{
11
+ int t;
12
+ cin>>t;
13
+ while(t--)
14
+ {
15
+ int n, k;
16
+ cin>>n>>k;
17
18
+ vector<pair<int, int>> a(n);
19
+ vector<int> b(n);
20
+ for(int i=0; i<n; i++)
21
22
+ cin>>a[i].first;
23
+ a[i].second = i;
24
+ }
25
26
27
+ cin>>b[i];
28
29
+ sort(a.begin(), a.end());
30
+ sort(b.begin(), b.end());
31
+ vector <int> ans(n);
32
33
34
+ ans[a[i].second] = b[i];
35
36
+ for(auto i : ans)
37
38
+ cout<<i<<" ";
39
40
+ cout<<endl;
41
42
+ return 0;
43
+}
0 commit comments