Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef __int64 LL;
const int maxn = 100000 + 10;
LL t[maxn];

struct point{
    int num;
    LL x;
    bool operator < (const point & rhs) const {
        if(x > rhs.x) return true;
        else if(x == rhs.x) {
            if(num > rhs.num) return true;
            else return false;
        }
        else return false;
    }
}p[maxn];

int main() {
    int n;
    LL a;
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) {
        scanf("%I64d", &a);
        p[i].num = i;
        p[i].x = a;
    }
    sort(p + 1, p + n + 1);
    for(int i = 1; i <= n; i++) {
        if(p[i].x == p[i + 1].x) t[p[i].num] = 0;
        else {
            t[p[i].num] = (p[i].x - p[i + 1].x) * i;
        }
        //printf("%d %d\n", p[i].num, p[i].x);
    }
    for(int i = 1; i <= n; i++) printf("%I64d\n", t[i]);
    return 0;
}


Compiler output:
a.cc:5:9: error: '__int64' does not name a type; did you mean '__int64_t'?
    5 | typedef __int64 LL;
      |         ^~~~~~~
      |         __int64_t
a.cc:7:1: error: 'LL' does not name a type
    7 | LL t[maxn];
      | ^~
a.cc:11:5: error: 'LL' does not name a type
   11 |     LL x;
      |     ^~
a.cc: In member function 'bool point::operator<(const point&) const':
a.cc:13:12: error: 'x' was not declared in this scope
   13 |         if(x > rhs.x) return true;
      |            ^
a.cc:13:20: error: 'const struct point' has no member named 'x'
   13 |         if(x > rhs.x) return true;
      |                    ^
a.cc:14:26: error: 'const struct point' has no member named 'x'
   14 |         else if(x == rhs.x) {
      |                          ^
a.cc: In function 'int main()':
a.cc:24:5: error: 'LL' was not declared in this scope
   24 |     LL a;
      |     ^~
a.cc:27:25: error: 'a' was not declared in this scope
   27 |         scanf("%I64d", &a);
      |                         ^
a.cc:29:14: error: 'struct point' has no member named 'x'
   29 |         p[i].x = a;
      |              ^
a.cc:33:17: error: 'struct point' has no member named 'x'
   33 |         if(p[i].x == p[i + 1].x) t[p[i].num] = 0;
      |                 ^
a.cc:33:31: error: 'struct point' has no member named 'x'
   33 |         if(p[i].x == p[i + 1].x) t[p[i].num] = 0;
      |                               ^
a.cc:33:34: error: 't' was not declared in this scope
   33 |         if(p[i].x == p[i + 1].x) t[p[i].num] = 0;
      |                                  ^
a.cc:35:13: error: 't' was not declared in this scope
   35 |             t[p[i].num] = (p[i].x - p[i + 1].x) * i;
      |             ^
a.cc:35:33: error: 'struct point' has no member named 'x'
   35 |             t[p[i].num] = (p[i].x - p[i + 1].x) * i;
      |                                 ^
a.cc:35:46: error: 'struct point' has no member named 'x'
   35 |             t[p[i].num] = (p[i].x - p[i + 1].x) * i;
      |                                              ^
a.cc:39:51: error: 't' was not declared in this scope
   39 |     for(int i = 1; i <= n; i++) printf("%I64d\n", t[i]);
      |                                                   ^
a.cc: In member function 'bool point::operator<(const point&) const':
a.cc:19:5: warning: control reaches end of non-void function [-Wreturn-type]
   19 |     }
      |     ^