Language: C++

#include<iostream>
#include<vector>
using namespace std;
struct stone{
    __int64 color;
    __int64 number;
    __int64 other_rela;
    __int64 rela;
};
int main(){
    __int64 N;
    cin>>N;
    vector<stone> stones;
    __int64 out=1;
    __int64 temp,last=-1;
    for(__int64 i=0;i<N;i++){
        cin>>temp;
        if(temp==last)
            continue;
        else
            last=temp;
        bool in=false;
        for(auto& each:stones){
            if(temp==each.color)/*找到temp*/{
                each.number++;
                out+=each.number*(each.number-1)/2-each.rela;
                each.rela=each.number*(each.number-1)/2;
                __int64 i=0;
                out+=each.other_rela;
                for(const auto& each_:stones){
                    if(each_.color!=each.color)
                        i+=each_.rela;
                }
                each.other_rela+=i;
                in = true;
                break;
            }
            
        }
        if(!in){
            stone temp_stone;
            temp_stone.color=temp;
            temp_stone.number=1;
            temp_stone.rela=0;
            __int64 i=0;
            for(const auto& each:stones){
                i+=each.rela;
            }
            temp_stone.other_rela=i;
            stones.push_back(temp_stone);
        }//新颜色
    }
    cout<<out<<endl;
    return 0;
}

Compiler output:
a.cc:5:5: error: '__int64' does not name a type; did you mean '__int64_t'?
    5 |     __int64 color;
      |     ^~~~~~~
      |     __int64_t
a.cc:6:5: error: '__int64' does not name a type; did you mean '__int64_t'?
    6 |     __int64 number;
      |     ^~~~~~~
      |     __int64_t
a.cc:7:5: error: '__int64' does not name a type; did you mean '__int64_t'?
    7 |     __int64 other_rela;
      |     ^~~~~~~
      |     __int64_t
a.cc:8:5: error: '__int64' does not name a type; did you mean '__int64_t'?
    8 |     __int64 rela;
      |     ^~~~~~~
      |     __int64_t
a.cc: In function 'int main()':
a.cc:11:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   11 |     __int64 N;
      |     ^~~~~~~
      |     __int64_t
a.cc:12:10: error: 'N' was not declared in this scope
   12 |     cin>>N;
      |          ^
a.cc:14:12: error: expected ';' before 'out'
   14 |     __int64 out=1;
      |            ^~~~
      |            ;
a.cc:15:12: error: expected ';' before 'temp'
   15 |     __int64 temp,last=-1;
      |            ^~~~~
      |            ;
a.cc:16:16: error: expected ';' before 'i'
   16 |     for(__int64 i=0;i<N;i++){
      |                ^~
      |                ;
a.cc:16:21: error: 'i' was not declared in this scope
   16 |     for(__int64 i=0;i<N;i++){
      |                     ^
a.cc:17:14: error: 'temp' was not declared in this scope; did you mean 'tm'?
   17 |         cin>>temp;
      |              ^~~~
      |              tm
a.cc:18:18: error: 'last' was not declared in this scope
   18 |         if(temp==last)
      |                  ^~~~
a.cc:24:27: error: 'struct stone' has no member named 'color'
   24 |             if(temp==each.color)/*找到temp*/{
      |                           ^~~~~
a.cc:25:22: error: 'struct stone' has no member named 'number'
   25 |                 each.number++;
      |                      ^~~~~~
a.cc:26:17: error: 'out' was not declared in this scope
   26 |                 out+=each.number*(each.number-1)/2-each.rela;
      |                 ^~~
a.cc:26:27: error: 'struct stone' has no member named 'number'
   26 |                 out+=each.number*(each.number-1)/2-each.rela;
      |                           ^~~~~~
a.cc:26:40: error: 'struct stone' has no member named 'number'
   26 |                 out+=each.number*(each.number-1)/2-each.rela;
      |                                        ^~~~~~
a.cc:26:57: error: 'struct stone' has no member named 'rela'
   26 |                 out+=each.number*(each.number-1)/2-each.rela;
      |                                                         ^~~~
a.cc:27:22: error: 'struct stone' has no member named 'rela'
   27 |                 each.rela=each.number*(each.number-1)/2;
      |                      ^~~~
a.cc:27:32: error: 'struct stone' has no member named 'number'
   27 |                 each.rela=each.number*(each.number-1)/2;
      |                                ^~~~~~
a.cc:27:45: error: 'struct stone' has no member named 'number'
   27 |                 each.rela=each.number*(each.number-1)/2;
      |                                             ^~~~~~
a.cc:28:24: error: expected ';' before 'i'
   28 |                 __int64 i=0;
      |                        ^~
      |                        ;
a.cc:29:27: error: 'struct stone' has no member named 'other_rela'
   29 |                 out+=each.other_rela;
      |                           ^~~~~~~~~~
a.cc:31:30: error: 'const struct stone' has no member named 'color'
   31 |                     if(each_.color!=each.color)
      |                              ^~~~~
a.cc:31:42: error: 'struct stone' has no member named 'color'
   31 |                     if(each_.color!=each.color)
      |                                          ^~~~~
a.cc:32:34: error: 'const struct stone' has no member named 'rela'
   32 |                         i+=each_.rela;
      |                                  ^~~~
a.cc:34:22: error: 'struct stone' has no member named 'other_rela'
   34 |                 each.other_rela+=i;
      |                      ^~~~~~~~~~
a.cc:42:24: error: 'struct stone' has no member named 'color'
   42 |             temp_stone.color=temp;
      |                        ^~~~~
a.cc:43:24: error: 'struct stone' has no member named 'number'
   43 |             temp_stone.number=1;
      |                        ^~~~~~
a.cc:44:24: error: 'struct stone' has no member named 'rela'
   44 |             temp_stone.rela=0;
      |                        ^~~~
a.cc:45:20: error: expected ';' before 'i'
   45 |             __int64 i=0;
      |                    ^~
      |                    ;
a.cc:47:25: error: 'const struct stone' has no member named 'rela'
   47 |                 i+=each.rela;
      |                         ^~~~
a.cc:49:24: error: 'struct stone' has no member named 'other_rela'
   49 |             temp_stone.other_rela=i;
      |                        ^~~~~~~~~~
a.cc:53:11: error: 'out' was not declared in this scope
   53 |     cout<<out<<endl;
      |           ^~~