Page 1 of 1
10795 - A Different Task
Posted: Sat Dec 18, 2004 8:41 am
by TISARKER
Is the following input arrangement valid?
Input :
3
3 2 1
3 1 2
Posted: Sat Dec 18, 2004 10:50 am
by alu_mathics
output:
-1
Posted: Sat Dec 18, 2004 1:10 pm
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?.
Posted: Sat Dec 18, 2004 5:17 pm
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.
Posted: Sat Dec 18, 2004 5:42 pm
by TISARKER
Sory for my sily mistake.
"The Orc Attack" is not my Problem.
My Problem is "A Different Task" Problem no 10795
Posted: Sat Dec 18, 2004 6:00 pm
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.
Re: 10795(A different Task)>What do u mean by valid arran
Posted: Sat Dec 18, 2004 7:04 pm
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.
10795 getting WA
Posted: Mon Sep 19, 2005 2:56 pm
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.
Posted: Tue Sep 20, 2005 6:15 am
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...
Re: 10795 - A Different Task
Posted: Thu Nov 27, 2008 10:33 am
by wahaha
how to solve this problem?
i have no idea. is it there are any formula?
i need some help, thx.
