ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1067. Disk Tree

What is wrong test 5
Posted by QAFQAZ.Alekber.Velizade 9 May 2010 15:43
#include <cstdlib>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int n,i,d,j;
string s[505],e[505][90],w,w2,a1,a2;

int main(int argc, char *argv[])
{
   cin>>n;
   for(i=0;i<n;i++)
        cin>>s[i];
   string p;
   p=1;

   w="";
   for(i=0;i<n;i++)
     {
            for(j=0;j<s[i].length();j++)
        if(s[i][j]=='\\')
            s[i][j]=1;
    }
   sort(s,s+n);

    for(i=0;i<n;i++)
        {
            d=0;
            for(j=0;j<s[i].length();j++)
            {w2=s[i][j];
            if(w2.compare(p)==0)
                {
                    d++;

                }
            else
                e[i][d]=e[i][d]+s[i][j];  }
        }
    for(j=0;j<80;j++)
        {if(e[0][j]!="")
            {for(d=0;d<j;d++)
            cout<<" ";

         cout<<e[0][j]<<endl;}

         else
             break;
        }
    for(i=1;i<n;i++)
        {a1="";
         a2="";
            for(j=0;j<80;j++)
                {a1=a1+e[i][j];
                a2=a2+e[i-1][j];

                    if(e[i][j]=="")
                    break;

                else if(a1!=a2)
                {       a1="";
                        a2="";
                        a1=a1+e[i][j];
                        a2=a1+e[i-1][j];
                        for(d=0;d<j;d++)
                        cout<<" ";
                    cout<<e[i][j]<<endl;}
                    }
        }

    return 0;
}
Re: What is wrong test 5
Posted by Assassin_Qafqaz(F.C) 13 May 2010 00:48
I find your mistake.You used c++.You must use delphi.ok?
Re: What is wrong test 5
Posted by Nazar 16 May 2010 10:01
Re: What is wrong test 5
Posted by QAFQAZ.Alekber.Velizade 6 Jun 2010 20:26
I got AC