AtCoder Beginner Contest 041 C - 背の順

,

http://abc041.contest.atcoder.jp/tasks/abc041_c

普段より簡単

implementation

#include <cstdio>
#include <vector>
#include <algorithm>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
#define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x)
using namespace std;
int main() {
    int n; scanf("%d", &n);
    vector<int> a(n); repeat (i,n) scanf("%d", &a[i]);
    vector<int> xs(n); whole(iota, xs, 0);
    whole(sort, xs, [&](int i, int j) { return a[i] > a[j]; });
    for (int i : xs) printf("%d\n", i+1);
    return 0;
}