-
26번인프런 알고리즘테스트 문제 2020. 8. 31. 20:02
#include<iostream> #include<vector> using namespace std; int main() { int max = 0; int cnt = 1; int N=0; cin >> N; vector<int> arr(N); vector<int> arr2(N); for (int i = 0; i < N; i++) { cin >> arr[i]; arr2[i] = 1; } for (int i = 1; i < N; i++) { for (int j = 0; j < i; j++) { if (arr[i] <= arr[j]) { arr2[i]++; } } } for (int i = 0; i < N; i++) { cout << arr2[i] << " "; } }