UVA 12599 - Black and White

UVA Sep 01, 2020

Problem PDF

Solution:

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ll long long
#define sc scanf
#define pf printf
#define pi 2*acos(0.0)
using namespace std;
int main()
{
    int t,n;
    string s;
    cin>>t;
    while(t--)
    {
        cin>>s;
        n=s.size();
        vectorv;
        int f=0;
        if(s[0]=='W'||s[n-1]=='B')
        {
            cout<<"IMPOSSIBLE"<3)
                break;
        }
        if(c==1)
        {
            cout<<"1"<
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12599/12599.cpp

Tags

Shipu Ahamed

CSPO® | Partly Product, Project Manager and Partly Software Engineer.

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.