c221115

🧩 Syntax:
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n, i, j, sum=0;
    bool f=1;
    cin>>n; int state=0;
    for( i=1; i<=n; i++ )
    {
        cin>>j;
        if( f && j==5 )state++;
        else if( f && j==10 )state+=2;
        else if( f && j==20 )state+=4;
        else f=0;
        if( f && state>=6 )state=6;
    }
    if( f && state!=6 )f=0;
    if( f )cout<<"Accepted";
    else cout<<"Rejected";

    cout<<endl;
    return 0;
}