Created
July 16, 2022 01:16
-
-
Save modos/68c1037a47163f3c41af6b89b97731fb to your computer and use it in GitHub Desktop.
جایگشت ها
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
const int N = 505; | |
int a[N]; | |
int main() | |
{ | |
int n; | |
cin >> n; | |
for (int i = 0;i < n;i++) | |
cin >> a[i]; | |
vector<int>ans; | |
for (int i = n - 1;i >= 0;i--) | |
ans.insert(ans.begin() + a[i], i); | |
cout << ans.front() + 1; | |
for (int i = 1;i < ans.size();i++) | |
cout << ',' << ans[i] + 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment