/ SeriousOJ /

Record Detail

Compile Error

foo.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       string s;
       cin>>s;
       long long q,cn=0;
       cin>>q;
       for(long long i=1;i<=q;i++)
       {
           int a,d;
           char c;
           cin>>a;
           if(a==1)
           {
               cn++;
           }
           else
           {
               cin>>d>>c;
               if(cn%2==0)
               {
               if(d==1)
               {
                   s.insert(0,1,c);
               }
               else
               {
                   long long q=s.length();
                   s.insert(q,1,c);
               }
               }
               else
               {
                if(d==2)
               {
                   s.insert(0,1,c);
               }
               else
               {
                   long long q=s.length();
                   s.insert(q,1,c);
               }
               }
           }

       }
       if(cn%2==1)
       {
           reverse(s.begin(),s.end());
       }
       cout<<s<<endl;
   }
}

Information

Submit By
Type
Submission
Problem
P1088 Mr. Heart's String Challenge
Contest
Brain Booster #5
Language
C99 (GCC 13.2.0)
Submit At
2024-09-05 16:37:20
Judged At
2024-10-03 13:06:45
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes