1 条题解
-
0CDQZxuyifeng LV 9 @ 2017-09-08 16:29:05
//-----------------------------------------AC code-----------------------------------------//
#include<cstdio> #include<algorithm> using namespace std; const int MAXN = 100005; int n, a[MAXN]; int main(){ // freopen("sort.in", "r", stdin); // freopen("sort.out", "w", stdout); scanf("%d", &n); for(int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] += i; sort(a+1, a+n+1); for(int i = 1; i <= n; i++) a[i] -= i; for(int i = 1; i < n; i++) if(a[i+1] < a[i]){ printf(":(\n"); return 0; } for(int i = 1; i <= n; i++) printf("%d\n", a[i]); return 0; }
- 1