/*
CodeForces 840A - Leha and Function [ 贪心 ] | Codeforces Round #429 (Div. 1)
A越大,B越小,越好
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5+5;
int a[N], b[N], c[N], n;
int aa[N], bb[N];
bool cmp1(int x, int y) {
return a[x] > a[y];
}
bool cmp2(int x, int y) {
return b[x] < b[y];
}
int main()
{
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
for (int i = 1; i <= n; i++) aa[i] = bb[i] = i;
sort(aa+1, aa+n+1, cmp1);
sort(bb+1, bb+n+1, cmp2);
for (int i = 1; i <= n; i++) c[bb[i]] = a[aa[i]];
for (int i = 1; i < n; i++) printf("%d ", c[i]);
printf("%d\n", c[n]);
}

  

CodeForces 840A - Leha and Function | Codeforces Round #429 (Div. 1)的更多相关文章

  1. CodeForces 840B - Leha and another game about graph | Codeforces Round #429(Div 1)

    思路来自这里,重点大概是想到建树和无解情况,然后就变成树形DP了- - /* CodeForces 840B - Leha and another game about graph [ 增量构造,树上 ...

  2. CodeForces 840C - On the Bench | Codeforces Round #429 (Div. 1)

    思路来自FXXL中的某个链接 /* CodeForces 840C - On the Bench [ DP ] | Codeforces Round #429 (Div. 1) 题意: 给出一个数组, ...

  3. Codeforces Round #429 (Div. 2/Div. 1) [ A/_. Generous Kefa ] [ B/_. Godsend ] [ C/A. Leha and Function ] [ D/B. Leha and another game about graph ] [ E/C. On the Bench ] [ _/D. Destiny ]

    PROBLEM A/_ - Generous Kefa 题 OvO http://codeforces.com/contest/841/problem/A cf 841a 解 只要不存在某个字母,它的 ...

  4. Codeforces Round #429 (Div. 2) 补题

    A. Generous Kefa 题意:n个气球分给k个人,问每个人能否拿到的气球都不一样 解法:显然当某种气球的个数大于K的话,就GG了. #include <bits/stdc++.h> ...

  5. Codeforces Round #429 (Div. 2)

    A. Generous Kefa   One day Kefa found n baloons. For convenience, we denote color of i-th baloon as  ...

  6. 【Codeforces Round #429 (Div. 2) C】Leha and Function

    [Link]:http://codeforces.com/contest/841/problem/C [Description] [Solution] 看到最大的和最小的对应,第二大的和第二小的对应. ...

  7. 【CodeForces】841C. Leha and Function(Codeforces Round #429 (Div. 2))

    [题意]定义函数F(n,k)为1~n的集合中选择k个数字,其中最小数字的期望. 给定两个数字集A,B,A中任意数字>=B中任意数字,要求重组A使得对于i=1~n,sigma(F(Ai,Bi))最 ...

  8. Codeforces Round #429 (Div. 2) - D Leha and another game about graph

    Leha and another game about graph 题目大意:给你一个图,每个节点都有一个v( -1 , 0 ,1)值,要求你选一些边,使v值为1 的点度数为奇数,v值为0的度数为偶数 ...

  9. 【推导】【DFS】Codeforces Round #429 (Div. 1) B. Leha and another game about graph

    题意:给你一张图,给你每个点的权值,要么是-1,要么是1,要么是0.如果是-1就不用管,否则就要删除图中的某些边,使得该点的度数 mod 2等于该点的权值.让你输出一个留边的方案. 首先如果图内有-1 ...

随机推荐

  1. 分布式架构下,session共享有什么方案么?

    分布式架构下,session共享有什么方案么? 会点代码的大叔 科技领域创作者 分布式架构下的session共享,也可以称作分布式session一致性:关于这个问题,和大家说一说解决方案(如果有其他的 ...

  2. VC++实现遍历指定文件夹

    VC++实现遍历指定文件夹,并进行深度遍历,一级,二级...最终列出该文件夹下所有文件全路径. #include "stdafx.h" #include <iostream& ...

  3. python 自学day1(关于if和file的应用练习)

    1.编写简单的登陆接口 #判断用户信息 #用户输入错误后锁定账号 流程图: 代码: #!/usr/bin/env python #-*- coding:utf-8 -*- document1 = op ...

  4. Winscp隧道实现-跳板机/跨机连接

    隧道用的是公网ip,登陆用的是私网ip 一张图应该就能看懂,后续用到新的功能继续编辑

  5. tomcat中server.xml各项配置详解

     详见大佬的文章,乐于做大佬文章的搬运工. http://www.cnblogs.com/starhu/p/5599773.html

  6. MySQL部分2

  7. go if 便捷语句

    之前使用java  C#没这么用过. 绝对新技能 if v := math.Pow(x, n); v < lim { 跟 for 一样,`if` 语句可以在条件之前执行一个简单的语句. 由这个语 ...

  8. (错误)启动ActiveMQ报错:Transport Connector could not be registered in JMX: java.io.IOException: Failed to bind to server socket: stomp://0.0.0.0:61613?

    一.错误报告 很明显,端口被占用 二.解决方法 1. 在cmd中输入 netstat -ano 查看61613端口被占用情况,如果有其他进程使用,则使用 taskkill /f /pid 进程PID  ...

  9. (二十八)jsp之EL表达式

    一.EL表达式简介 EL 全名为Expression Language.EL主要作用: 1.获取数据 EL表达式主要用于替换JSP页面中的脚本表达式,以从各种类型的web域 中检索java对象.获取数 ...

  10. Flash播放控件属性详解

    Flash 播放控件属性详解 一.属性篇 1.AlignMode(读写)  语法:AlignMode As Long  说明:对齐方式(与SAlign 属性联动).当控件的长宽比例与影片不一致且WMo ...