Submission #924656

#TimeUsernameProblemLanguageResultExecution timeMemory
924656biankStone Arranging 2 (JOI23_ho_t1)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define forn(i,n) for(int i=0;i<int(n);i++) #define forsn(i,s,n) for(int i=int(s);i<int(n);i++) int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector<int> a(n);  map<int,int> last; forn(i,n){    cin >> a[i];    last[a[i]]=i; } forn(i,n){ int j=last[a[i]]; forsn(k,i,j) a[k]=a[j]; i=j; } forn(i,n) cout << a[i] << '\n'; }

Compilation message (stderr)

Main.cpp:10:2: error: extended character   is not valid in an identifier
   10 |   map<int,int> last;
      |  ^
Main.cpp:12:2: error: extended character   is not valid in an identifier
   12 |     cin >> a[i];
      |  ^
Main.cpp:12:5: error: extended character   is not valid in an identifier
   12 |     cin >> a[i];
      |    ^
Main.cpp:13:2: error: extended character   is not valid in an identifier
   13 |     last[a[i]]=i;
      |  ^
Main.cpp:13:5: error: extended character   is not valid in an identifier
   13 |     last[a[i]]=i;
      |    ^
Main.cpp: In function 'int main()':
Main.cpp:10:2: error: '\U000000a0map' was not declared in this scope
   10 |   map<int,int> last;
      |  ^~~~
Main.cpp:10:8: error: expected primary-expression before 'int'
   10 |   map<int,int> last;
      |       ^~~
Main.cpp:12:2: error: '\U000000a0' was not declared in this scope
   12 |     cin >> a[i];
      |  ^
Main.cpp:13:4: error: expected ';' before '\U000000a0last'
   13 |     last[a[i]]=i;
      |   ^~~~~~
      |   ;
Main.cpp:16:11: error: 'last' was not declared in this scope
   16 |     int j=last[a[i]];
      |           ^~~~