Submission #924652

#TimeUsernameProblemLanguageResultExecution timeMemory
924652biankStone 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:1:30: warning: extra tokens at end of #include directive
    1 | #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; }
      |                              ^~~~~~~~~
Main.cpp:1:9: fatal error: bits/stdc++.h>usin: No such file or directory
    1 | #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; }
      |         ^~~~~~~~~~~~~~~~~~~~
compilation terminated.