10795 - A Different Task

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

Moderator: Board moderators

Post Reply
TISARKER
Learning poster
Posts: 88
Joined: Tue Oct 12, 2004 6:45 pm
Location: Bangladesh
Contact:

10795 - A Different Task

Post by TISARKER »

Is the following input arrangement valid?
Input :
3
3 2 1
3 1 2
Last edited by TISARKER on Sat Dec 18, 2004 5:37 pm, edited 2 times in total.
Mr. Arithmetic logic Unit
alu_mathics
Learning poster
Posts: 55
Joined: Sat Jan 24, 2004 9:30 pm
Location: Chittagong
Contact:

Post by alu_mathics »

output:

-1
cuii e
TISARKER
Learning poster
Posts: 88
Joined: Tue Oct 12, 2004 6:45 pm
Location: Bangladesh
Contact:

Post by TISARKER »

Sory, I could not Understand the output.
Please Breifly explain it.

I also want some test input and output.
Can anyone give me it?.
Mr. Arithmetic logic Unit
alu_mathics
Learning poster
Posts: 55
Joined: Sat Jan 24, 2004 9:30 pm
Location: Chittagong
Contact:

Post by alu_mathics »

3
3 2 1
3 1 2

for ur input the graph matrix would be

1 2 3 4 5 6
1 0 - - - - -
2 - 0 - - - -
3 2 1 0 - - -
4 - - - 0 - -
5 - - - - 0 -
6 - - - - - 0

here '-' stands for infinity.
the matrix need to be 6*6 atleast.as u want to find a rally point from which the fr five positions are in unidistance.
as u can not find no such point after running floyd or whatever u want u find , output -1.

hope it makes u clear.
cuii e
TISARKER
Learning poster
Posts: 88
Joined: Tue Oct 12, 2004 6:45 pm
Location: Bangladesh
Contact:

Post by TISARKER »

Sory for my sily mistake.
"The Orc Attack" is not my Problem.
My Problem is "A Different Task" Problem no 10795
Mr. Arithmetic logic Unit
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho »

Of course it's valid input, the output should be "Case 1: 7".
Actually, if all the input numbers are within 1 to 3 inclusive, then the input must be valid.
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Re: 10795(A different Task)>What do u mean by valid arran

Post by little joey »

TISARKER wrote:Is the following input arrangement valid?
Input :
3
3 2 1
3 1 2
The 7 moves are:
move disk 1 from 3 to 1
move disk 2 from 2 to 3
move disk 1 from 1 to 3
move disk 3 from 1 to 2
move disk 1 from 3 to 2
move disk 2 from 3 to 1
move disk 1 from 2 to 3

Hope it helps.
Ahmed_Hasan
New poster
Posts: 7
Joined: Sat Jul 09, 2005 7:58 pm

10795 getting WA

Post by Ahmed_Hasan »

getting WA
I have tried my program with the following IO

Code: Select all

input:
5
1 1 1 1 1
2 3 1 2 3
5
2 3 1 2 3
3 3 3 3 3
5
1 1 1 1 1
3 3 3 3 3
5
1 1 1 1 1
3 1 2 2 1
6
1 1 1 2 2 2
2 2 2 3 3 3
9
1 2 3 3 2 1 1 2 3
3 2 1 1 2 3 3 2 1
4
1 1 1 1
2 2 2 3
4
1 1 1 2
1 1 1 3
4
1 1 1 1
1 1 1 1
3
1 1 1
2 2 2
3
1 2 3
3 2 1
0

output:
Case 1: 21
Case 2: 10
Case 3: 31
Case 4: 13
Case 5: 56
Case 6: 219
Case 7: 8
Case 8: 1
Case 9: 0
Case 10: 7
Case 11: 3
if any body who made this accepted please give some more IO
verified with your program.
Last edited by Ahmed_Hasan on Sun Sep 25, 2005 5:24 pm, edited 2 times in total.
Dreamer#1
Learning poster
Posts: 77
Joined: Tue Oct 07, 2003 10:07 pm

Post by Dreamer#1 »

I think you've partially posted your inputs because the last 7 outputs you've posted corresponds to the 7 inputs but the 1st 4 inputs are missing. The inputs that you've posted here produces the correct output (i.e. the last 7 outputs are correct for your 7 inputs).

I can't remember exatly whether u need unsigned long long or not but my code has unsigned long long so may be you can try that.

If even that fails then tell me about your algo then may be I can try to find your mistake.

best of luck.

regards...
wahaha
New poster
Posts: 16
Joined: Mon Jul 14, 2008 6:18 pm

Re: 10795 - A Different Task

Post by wahaha »

how to solve this problem?

i have no idea. is it there are any formula?

i need some help, thx. :)
Post Reply

Return to “Volume 107 (10700-10799)”