aboutsummaryrefslogtreecommitdiff
path: root/SequenceEquation.cpp
blob: 1714728bcab842b9d4e0e5ef5eebab7f6f197d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<bits/stdc++.h>

using namespace std;

int main(){
  int n, count = 1;
  cin >> n;
  vector<int> v(n);
  map<int, int> mp;
  for(auto &x : v){
    cin >> x;
    mp[x] = count;
    count++;
  }
  for(auto x : mp){
    auto it = find(v.begin(), v.end(), x.second);
    cout << "value: " << x.first << " Index: " << x.second << endl;
    cout << it - v.begin() + 1<< endl;
  }

  


  return 0;
}