UVA 11661 - Burger Time?

UVA Sep 1, 2020

Problem PDF

Solution:

#include
#include
char a[2000010];
int main()
{
    int n,i,d,min,f;
    while(scanf("%d",&n)==1)
    {
        if(n==0)
        break;
        scanf("%s",a);
        f=0;
        d=1;
        min=2000010;
        for(i=0;id)
                min=d;
                i--;
                d=1;
                break;

            }
            else if(a[i]=='Z')
            {
              min=0;
              f=1;
              break;
            }

            }
        }
        else if(a[i]=='D')
        {
            i++;
            for(i=i;id)
                min=d;
                i--;
                d=1;
                break;
            }
            else if(a[i]=='Z')
            {
              min=0;
              f=1;
              break;
            }

            }

        }
        else
        continue;
    }
    printf("%d\n",min);
    }
    return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11661/11661.cpp

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.