Background
The fantasy of the little Cedar came to the scene of the classic VCDs "proposing the big battle" ...
He is watching the slide at the wedding, while looking at the lovely bride long Yamei, while thinking, if you can do it again (-.-why fantasy so depressed scene ... )。
Shans as a new generation of mountain wisdom long, in devout in the heart shout thousands of times later, the Goblin finally appeared.
The goblin said, I can still help you back to this picture of the past, let you do it again, but you have to do me a favor.
(If you have any questions about the plot, please watch the original play)
Describe
It turned out that Mr. Goblin had lived in a church in Hawaii for too long, and the letters piled up too much in the house, and your job was to help him sort out the letters.
A total of n letters, each with its own signature and serial number.
Format input Format
Each set of test data
The first line has n numbers, which are non-repeating positive integers that do not exceed N, representing the number of n letters.
The second line also has n number, is a valid number not more than 255 bits of floating-point numbers (no leading 0 and both are greater than 0), representing the signature of the N letter.
The sequence number and the signature of the letter correspond to the given order one by one. There is a space between the sequence number and the ordinal, the signature and the signature, and there are no extra spaces in both lines.
(1<=n<=1000)
Output format
Output n rows for each set of data
Please output the signature of the letter in ascending order of ordinal
One signature per line, and the format of the signature should be exactly the same as the input
Example 1 sample input 1[copy]
3 1 21.0) 21.2 1
Sample output 1[Copy]
21.211.0
Recently in the vijos above the problem, the above topic quality can also, but the description is really the pit father.
This topic mainly practice input. Get a new skill
/************************************************author:guanjuncreated time:2016/2/20 15:35:59File Name: vijosp1389.cpp*************************************************/#include<iostream>#include<cstring>#include<cstdlib>#include<stdio.h>#include<algorithm>#include<vector>#include<queue>#include<Set>#include<map>#include<string>#include<math.h>#include<stdlib.h>#include<iomanip>#include<list>#include<deque>#include<stack>#include<sstream>#defineull unsigned long Long#definell Long Long#defineMoD 90001#defineINF 0x3f3f3f3f#defineMAXN 10000+10#defineCLE (a) memset (A,0,sizeof (a))Constull inf = 1LL << A;Const Doubleeps=1e-5;using namespaceStd;priority_queue<int,vector<int>,greater<int> >PQ;structnode{intx, y;};structcmp{BOOL operator() (Node A,node b) {if(a.x==b.x)returnA.y>b.y; returnA.x>b.x; }};structnode{intID; strings;} NOD[MAXN];BOOLCMP (node A,node b) {returna.id<b.id;}intA[MAXN];intMain () {#ifndef Online_judge//freopen ("In.txt", "R", stdin); #endif //freopen ("OUT.txt", "w", stdout); intn=0; strings; StringStream SS; Getline (cin,s); SS<<s; while(ss>>a[++n]); N--; for(intI=1; i<=n;i++) {nod[i].id=A[i]; CIN>>Nod[i].s; } sort (Nod+1, nod+1+n,cmp); for(intI=1; i<=n;i++) {cout<<nod[i].s<<Endl; } return 0;}
Background
The fantasy of the little Cedar came to the scene of the classic VCDs "proposing the big battle" ...
He is watching the slide at the wedding, while looking at the lovely bride long Yamei, while thinking, if you can do it again (-.-why fantasy so depressed scene ... )。
Shans as a new generation of mountain wisdom long, in devout in the heart shout thousands of times later, the Goblin finally appeared.
The goblin said, I can still help you back to this picture of the past, let you do it again, but you have to do me a favor.
(If you have any questions about the plot, please watch the original play)
Describe
It turned out that Mr. Goblin had lived in a church in Hawaii for too long, and the letters piled up too much in the house, and your job was to help him sort out the letters.
A total of n letters, each with its own signature and serial number.
Format input Format
Each set of test data
The first line has n numbers, which are non-repeating positive integers that do not exceed N, representing the number of n letters.
The second line also has n number, is a valid number not more than 255 bits of floating-point numbers (no leading 0 and both are greater than 0), representing the signature of the N letter.
The sequence number and the signature of the letter correspond to the given order one by one. There is a space between the sequence number and the ordinal, the signature and the signature, and there are no extra spaces in both lines.
(1<=n<=1000)
Output format
Output n rows for each set of data
Please output the signature of the letter in ascending order of ordinal
One signature per line, and the format of the signature should be exactly the same as the input
Example 1 sample input 1[copy]
3 1 21.0) 21.2 1
Sample output 1[Copy]
21.211.0
Vijos P1389 The little cedar at the wedding