2020-01-10 20:07:10 C++

C++

Copy Copied! Full
#include <bits/stdc++.h> #define ALL(A) (A).begin(),(A).end() #define ll long long #define rep(i,n) for(int i=0;i<(n);i++) const ll mod = 1e9+7; const ll INF = -1*((1LL<<63)+1); const int inf = -1*((1<<31)+1); using namespace std; int main(void){ cin.tie(0); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20); int N; cin >> N; vector<int> a(N); map<int,int> mp; rep(i,N){ cin >> a[i]; mp[a[i]]; } cout << endl; int cnt = 0; for(auto x:mp){ x.second = cnt; cnt++; //cout << x.first << " " << x.second << endl; } for(int i=0;i<N;i++){ cout << mp[a[i]] << endl; } }
RECOMMEND