You are not logged in. Please login at www.codechef.com to post your questions!

×

WRONG ANSWER ON SPELLBOB.WHY???

include<iostream>

include<cstring>

using namespace std;

int main()

{ int j=0,m=0,k=0,i=0;

char s[5]={0},t[5]={0};

cin>>k;

for( i=0;i<k;i++)

{

    m=-1;

    cin>>s>>t;

    for(j=0;j<3;j++)

    {

        if(s[j]=='o'||t[j]=='o')

        {

            m=j;

            break;

        }

    }
    if(j==3)

    {

        cout<<"no\n";

    }

    else

    {

        for(j=0;j<3;j++)

        {


            if(s[j]=='b'||t[j]=='b'||j==m)

            {

                continue;

            }

            else

            {

                cout<<"no\n";

                break;

            }

        }

        if(j==3)

        {

            cout<<"yes\n";

        }

    }

}
return 0;

}

asked 14 Aug '18, 18:58

sumitmnit's gravatar image

3★sumitmnit
1
accept rate: 0%


Hi I'm not sure what's wrong but i checked your code on various test cases, your code gave me a wrong answer on this one

1

bbo

ooo

Your output : no

Hope this helps (:

link

answered 14 Aug '18, 19:24

agron_x's gravatar image

4★agron_x
111
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,424
×72

question asked: 14 Aug '18, 18:58

question was seen: 97 times

last updated: 14 Aug '18, 19:24