11192 - Group Reverse

All about problems in Volume CXI. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

11192 - Group Reverse

Postby Mister X » Sun Mar 04, 2007 6:18 pm

:( no idea why WA on such an easy problem

cut...
Last edited by Mister X on Mon Mar 05, 2007 3:49 pm, edited 1 time in total.
Mister X
New poster
 
Posts: 5
Joined: Sun Mar 04, 2007 6:08 pm

Postby arsalan_mousavian » Sun Mar 04, 2007 6:25 pm

your program fails on
Code: Select all
1 abcde

the output should be:
Code: Select all
edcba

have fun
In being unlucky I have the record.
User avatar
arsalan_mousavian
Experienced poster
 
Posts: 111
Joined: Mon Jan 09, 2006 6:19 pm
Location: Tehran, Iran

Postby Mister X » Sun Mar 04, 2007 6:29 pm

:oops: :oops: :oops: :oops: :oops: :oops:
Mister X
New poster
 
Posts: 5
Joined: Sun Mar 04, 2007 6:08 pm

11192,WA

Postby turcse143 » Tue Jun 26, 2007 6:05 pm

HI, everybody i solve this problem but i got WA.
I don't know the problem of my code.

I want more sample input/output.
Is this sample input/output only for the special case:G=1;

Ples help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :cry:
turcse143
Learning poster
 
Posts: 81
Joined: Wed May 09, 2007 9:59 pm
Location: (CSE,DU) Dhaka,Bangladesh

Postby Jan » Wed Jun 27, 2007 10:48 pm

Try the cases.

Input:
Code: Select all
1 ABCDEFGHIJKLMNOPQRSTUVWX
2 ABCDEFGHIJKLMNOPQRSTUVWX
3 ABCDEFGHIJKLMNOPQRSTUVWX
4 ABCDEFGHIJKLMNOPQRSTUVWX
6 ABCDEFGHIJKLMNOPQRSTUVWX
8 ABCDEFGHIJKLMNOPQRSTUVWX
0

Output:
Code: Select all
XWVUTSRQPONMLKJIHGFEDCBA
LKJIHGFEDCBAXWVUTSRQPONM
HGFEDCBAPONMLKJIXWVUTSRQ
FEDCBALKJIHGRQPONMXWVUTS
DCBAHGFELKJIPONMTSRQXWVU
CBAFEDIHGLKJONMRQPUTSXWV

Hope these help.
Ami ekhono shopno dekhi...
HomePage
Jan
Guru
 
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh

Postby turcse143 » Thu Jun 28, 2007 8:43 pm

:) thanks GURU, i got AC
THANKS A LOT
turcse143
Learning poster
 
Posts: 81
Joined: Wed May 09, 2007 9:59 pm
Location: (CSE,DU) Dhaka,Bangladesh

Re: 11192 - Group Reverse

Postby Obaida » Mon May 26, 2008 10:58 am

It seemed very easy to me.
I just calculated the length and then divided the length by G to find the group length.
then in next step run a loop to length. and when it's divisible then reverse. :)
try_try_try_try_&&&_try@try.com
This may be the address of success.
Obaida
A great helper
 
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Re: 11192 - Group Reverse

Postby maruf » Thu Jun 19, 2008 12:21 pm

thank u shiplu vai
i hv got ac :D
Last edited by maruf on Sun Jun 22, 2008 12:52 pm, edited 1 time in total.
lives for eternity......
maruf
New poster
 
Posts: 17
Joined: Sat May 24, 2008 6:00 pm

Re: 11192 - Group Reverse

Postby shiplu_1320 » Fri Jun 20, 2008 11:46 am

input
Code: Select all
 1 S

your code output a null after S
write the output in a file for this input and see.

Good luck.
A learner......
shiplu_1320
New poster
 
Posts: 32
Joined: Sat Dec 29, 2007 9:08 pm
Location: CSEDU , Dhaka

Re: 11192 - Group Reverse

Postby scofield » Tue Jan 31, 2012 3:54 pm

Hello, i solved the problem but i always got Wrong Answer, i can't identify what's wrong in the code.
Could you please give me a help to check what's wrong?

Thanks in advance.
scofield
New poster
 
Posts: 2
Joined: Tue Jan 31, 2012 3:20 am

Re: 11192 - Group Reverse

Postby nazmus_20000 » Fri Dec 14, 2012 9:06 pm

Please can any one tell why i am getting compiler Error????I m really fed up with this things...

#include<stdio.h>
#include<string.h>
int main()
{
int n,i,j,k,l,t;
char a[1000],b[1000];
while(scanf("%d",&n)!=EOF)
{
if(n==0)break;
else
{
scanf("%s",&a);
l=strlen(a)/n;
for(i=0,j=0;i<n;i++)
{
for(k=0,t=0;t<l;k++,t++)
{
b[k]=a[j];
j++;
}
b[k]='\0';
strrev(b);
printf("%s",b);
}
printf("\n");
}
}
return 0;
}
nazmus_20000
New poster
 
Posts: 7
Joined: Fri Dec 14, 2012 9:01 pm

Re: 11192 - Group Reverse

Postby brianfry713 » Sat Dec 15, 2012 6:19 am

You can see the reason for your Compiler Error by clicking My Submissions.

In this case it's because strrev() isn't included in the judge's compiler. Write your own strrev().
brianfry713
Guru
 
Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11192 - Group Reverse

Postby nazmus_20000 » Mon Dec 17, 2012 6:42 pm

Thanks got ac....@brianfry713 :) :) :) :) :) :) :)
nazmus_20000
New poster
 
Posts: 7
Joined: Fri Dec 14, 2012 9:01 pm


Return to Volume CXI

Who is online

Users browsing this forum: No registered users and 1 guest