a5d49c0c3f
pta sucks
32 lines
603 B
C
32 lines
603 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#pragma GCC optimize("Ofast,inline")
|
|
#define MAXLEN 31
|
|
|
|
int main(void) {
|
|
int lines;
|
|
scanf("%d", &lines);
|
|
|
|
// Fancy way of allocating memory to 2d array
|
|
char *arr[lines];
|
|
for (int i = 0; i < lines; i++) {
|
|
arr[i] = malloc(sizeof(char) * MAXLEN);
|
|
}
|
|
|
|
// Populate the 2d array
|
|
for (int i = 0; i < lines; i++) {
|
|
scanf("%s", arr[i]);
|
|
}
|
|
|
|
// Populate the order array
|
|
int order[lines];
|
|
for (int i = 0; i < lines; i++) {
|
|
scanf("%d", &order[i]);
|
|
}
|
|
|
|
for (int i = 0; i < lines; i++) {
|
|
printf("%s\n", arr[order[i]]);
|
|
}
|
|
return 0;
|
|
}
|