codeforces 180F Mathematical Analysis Rocks!
来源:互联网 发布:淘宝网怎么换货 编辑:程序博客网 时间:2024/06/07 02:34
#116 div2
给一个长度为n的序列a表示起初第i个人拿着第a[i]个人的作业,再给一个同样长度的序列b表示最终i拿着b[i]的作业,求序列p。序列p是一个1-n的排列,表示每过一天后,i 要把他手中的书给p[i]
直接将(ai,bi)二元组排序,然后输出排序后的b数组即可
#include <iostream>#include <utility>#include <cstring>#include <cstdio>#include <algorithm>#define rep(i, j, k) for(int i = j; i <= k; i++)using namespace std;int main (){int n;cin >> n;int x, y;pair<int, int>a[100009];rep (i, 1, n)scanf ("%d", &a[i].first);rep (i, 1, n)scanf ("%d", &a[i].second);sort (a + 1, a + 1 + n);printf ("%d", a[1].second);rep (i, 2, n)printf (" %d", a[i].second);cout << endl;return 0;}
0 0
- codeforces 180F Mathematical Analysis Rocks!
- 【翻译】Mathematical Analysis of Algorithms
- Mathematical Statistics and Data Analysis笔记
- Codeforces 659F F
- Harmony Analysis CodeForces
- Codeforces 234 F. Fence
- 【Codeforces 500F】Dp
- codeforces 234F - Fence
- F-Logo Turtle codeforces
- 【CODEFORCES】 F. Ant colony
- Codeforces 567F
- CodeForces 241F Race
- Codeforces 611F 思维
- Codeforces 542F 构造
- codeforces 626f
- codeforces 622f
- codeforces 628F
- codeforces 652F
- DOTween插件的学习经验(一)
- POJ 1991 Turning in Homework 区间DP
- LHS、RHS
- Unable to get debug signature key
- Linux中的libc和glibc
- codeforces 180F Mathematical Analysis Rocks!
- 连续子数组最大和
- 一看就懂系列之 protobuf的php版的教程
- tyvj P2018 「Nescafé26」小猫爬山
- 【openCV入门之四】 Core组件进阶
- 解决内存泄露问题的改良版MVP模式
- RobotFramework/PythonRemoteServer
- 终极报错解决方案:Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with
- 抽象工厂方法模式