6 solutions

  • 0
    @ 2026-9-13 18:21:17
    #include<bits/stdc++.h>
    using namespace std;
    int q[100];
    int f=0,r=0;
    void push(int x){
        q[r++]=x;
    }
    void pop(){
        f++;
    }
    int fr(){
        return q[f];
    }
    int sz(){
        return r-f;
    }
    int main(){
        string s;
        cin>>s;
        for(int i=0;i<8;i++){
            push(s[i]-'0');
        }
        while(sz()!=0){
            cout<<fr();
            pop();
            if(sz()==0) break;
            push(fr());
            pop();
            push(fr());
            pop();
        }
        return 0;
    }
    
    

    Information

    ID
    2321
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    19
    Accepted
    9
    Uploaded By