Page 2 of 3

Posted: Thu Jul 17, 2003 8:37 am
by Dominik Michniewski
It looks like I made mistake in outputing :oops:
I realize (after changing code to take maximal element as pivot), that I have right values, but my matrix is transposed ... so I think that's my problem :oops::oops: I am sometimes so stupid ....

Thanks all for help. there is another problem, which learn me something :) and I must be more carefully ...

Best regards

Posted: Mon Jul 21, 2003 2:28 pm
by Dominik Michniewski
Unfortunatly I've got WA many times .... I try many options, but still WA ...
Could anyone help me and post more test cases ?

Best gerads

Posted: Mon Jul 21, 2003 3:20 pm
by Per
Dominik, you should try this test case:

Code: Select all

It's always the simple things... :)

Posted: Tue Jul 22, 2003 8:08 am
by Dominik Michniewski
Thanks Per :) again and again :)
This was silly mistake .... very silly .... I misunderstood problem - I think that matrix 1x1has not inverse ....
Now I got Accepted :):)

Best regards

Posted: Tue Jul 22, 2003 9:19 am
by anupam
Hey hey hey!!!
Very easy!!!!!!!!!!!!! :lol:

10524 Matrix Reloaded after rejudgement

Posted: Thu Aug 28, 2003 12:30 pm
by Alexander Kozlov
I am totaly disorientated. My AC program gets WA now, but I have checked it many times.
What do the words "No pivoting is allowed" mean? Can somebody explain it or give us an example of input and output?
And what is the limit value for matrix elements?


Posted: Thu Aug 28, 2003 2:58 pm
by Dominik Michniewski
It's easy !!
When in time of computing you analize row 3 nad matrix is i.e.:


your program must answer "not possible" - that's all . but you see that such matrix exist - you can exchange rows 3 and 4 and everything is ok :)
but in this problem - it's impossible :)

Best regards

Posted: Thu Aug 28, 2003 7:37 pm
by anupam
actually ,
i saw many to solve the problem using pivoting.
actually, pivoting is a special corrector method.
but when a method was not perticularly said
(when there are multiple method creting multiple answer),
it's not better or wise to use that method. use the simple,
not the complex if others are not said.
I am poor in English. I know. But i think
you all will understand what i want to say.
the line is added for just clarity.
The problem was given in the contest as a easy problem.
But thinking complex made it complex.
And, from the numerical methods' point of view,
there may be many methods producing different answer.
If other way is not said, it is better to use the simple.
And, like you, many questioned me whether to do it using
pivoting or not.
So, for clarity pivoting is removed(The mathod was not used
the first time, the line is just added,not any other change but some
tripical test cases.).
So check for tripical test cases and those who got wa can
easily get ac.
And sorry for the late.
It's for the server upgrading.
Anupam :oops:

Posted: Thu Aug 28, 2003 9:36 pm
by Alexander Kozlov
Thank you, Dominik!
Thank you, Anupam!

I got AC.

Posted: Thu Aug 28, 2003 11:28 pm
by Larry
Can someone post some cases that'll trip things up? Thanks.


Posted: Wed Oct 22, 2003 7:44 pm
by Caesum
This problem is really unclear. What on earth does 'no pivoting is allowed' mean ? Are you saying that:
all matrices are 2*2 or less, or diagonal ? If you calculate the inverse of a 2*2 matrix in general then surely you have used pivoting although it is not completely obvious ? Or are there things like general 3*3 matrices in the input and we should use the formula ? How far does this go ? What on earth is this problem really saying ?
I don't understand the example above at all, the matrix given has an inverse, is it necessary to use pivoting to find it ? Well...... no, it isn't since the matrix given is clearly self inverse........ help!!!!!!!

Posted: Wed Oct 22, 2003 10:21 pm
by Per
The "no pivoting" comment says (or at least I assumed so, and got AC) that:

"Since we assume you're using the method of Gaussian elimination for inverting matrices, you are not, in this process, allowed to swap two rows (or two columns)."

For people who want to solve it some other way (some people have great imagination :)), well, good luck...

Posted: Wed Oct 22, 2003 10:32 pm
by Larry
Can someone post some inputs/outputs? I think my precision is not good enough. Thanks.

Posted: Wed Oct 22, 2003 11:07 pm
by Caesum
Per: that still does not apply to the case above you can add row four to row three:


now subtract row three from row 4:

100 0|10 00
010 0|01 00
001 1|00 11

multiply row 4 by -1:

and subtract row 4 from row3:


Posted: Wed Oct 22, 2003 11:42 pm
by Per
Yeah, OK, it's a question as to how you define Gaussian elimination.

The way I've usually seen it, you first have a "forward elimination" (direct translation of the swedish term, not sure if it's correct) phase where you make the matrix upper triangular. In this phase, you first add multiples of row 1 to rows 2..n, then multiples of row 2 to rows 3..n, and so on, and that's it: you never add a row to the rows above it. Then, similarly, there's the "backward elimination" phase to make the matrix lower triangular as well.