// Copyright © 2021 ์์ฃผํ. All rights reserved.
//
// https://www.acmicpc.net/problem/1015
// BOJ1015 ์์ด ์ ๋ ฌ
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int A; //๋ฐฐ์ด์ ํฌ๊ธฐ
cin >> A;
vector<int>arr_value;
vector<int>arr_index;
vector<int>ans;
for (int i = 0; i < A; i++) {
int number;
cin >> number;
arr_value .push_back(number);
arr_index.push_back(number);
}
sort(arr_index.begin(), arr_index.end());
for (int i = 0; i < A; i++) {
for (int j = 0; j < A; j++) {
if (arr_value[i] == arr_index[j]) {
ans.push_back(j);
arr_index[j] = -1; //๋จผ์ ๋์ค๋ ๋๊ฐ์ ๊ฐ์ ์ธ๋ฑ์ค๋ก ํ๋จํ ์ ์๊ธฐ๋๋ฌธ์ ๊ฐ ๋ณ๊ฒฝ.
break;
}
}
}
for (int i = 0; i < A; i++) {
cout << ans[i]<<" ";
}
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 1026๋ฒ - ๋ณด๋ฌผ (0) | 2021.10.16 |
---|---|
[๋ฐฑ์ค,c++] 10174๋ฒ - ํฐ๋ฆฐ๋๋กฌ (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 10159๋ฒ - ์ ์ธ (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 1012๋ฒ - ์ ๊ธฐ๋ ๋ฐฐ์ถ (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 1010๋ฒ - ๋ค๋ฆฌ ๋๊ธฐ (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 1009๋ฒ - ๋ถ์ฐ์ฒ๋ฆฌ (0) | 2021.10.16 |
๋๊ธ