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 1507. Difficult Decision

Miha Zimin To test makers [14] // Problem 1507. Difficult Decision 1 Nov 2006 14:35
What is test 42?
please, give me some hint

10
1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 1

In my WA 42 programm output "No"
Anton [SUrSU] Re: To test makers [13] // Problem 1507. Difficult Decision 1 Nov 2006 17:28
In test#42 n = 1 then print Yes
Miha Zimin Re: To test makers [12] // Problem 1507. Difficult Decision 1 Nov 2006 21:37
Thanks, but I think you are wrong.
I checked it:

int n;
...
int main()
{
    cin >> n;

    if(n == 1)
    {
        double *f = new double[0xfffffff];

        cout << "Yes";
        return 0;
    }

        ...
}

And this code has WA (on test 42), but not Crash or Memory limit. Therefore n is no 1 in test 42.

I need some hints as before :-)
please :-)
Anton [SUrSU] Re: To test makers [11] // Problem 1507. Difficult Decision 1 Nov 2006 22:14
I add this code to my last solution and got AC...
  if (n * (n - 1) == 0) {
    cur = e;
    ok = 1; // Yes
  }
Miha Zimin Re: To test makers // Problem 1507. Difficult Decision 1 Nov 2006 22:46
It's strange, but I have WA 42 as before.
:-(
Who was need rejudge?
It's so strange. My desicion was AC (2 day ago), but now I don't know what can I do with this problem.

WA 42
Vladimir Yakovlev (USU) N=2 in test 42 (-) [8] // Problem 1507. Difficult Decision 2 Nov 2006 01:47
Beautiful Mind Re: N=2 in test 42 (-) [7] // Problem 1507. Difficult Decision 2 Nov 2006 20:40

 I got wrong answer at test 33. does it enough to use
 long long as data type.
Anton [SUrSU] Re: N=2 in test 42 (-) [6] // Problem 1507. Difficult Decision 2 Nov 2006 21:52
Use 0 or 1 to present matrix value's
Beautiful Mind Re: N=2 in test 42 (-) // Problem 1507. Difficult Decision 3 Nov 2006 09:36
Thank u very much Anton , I got accepted. I don't know why i didn't think about that Still i am quite a stupid.

Edited by author 03.11.2006 09:37

Edited by author 03.11.2006 09:37
Hayk Time Lmit Exceeded [3] // Problem 1507. Difficult Decision 4 Nov 2006 02:10
Hello collegues ! :)

Can you tell me ... are you geting matrix B (with 0 1).
I tried that way and got TLE.
it comes about n*(n+1)*n^3 operatons.
Maybe there are more soft methods...
Olecksandr[LNU] Re: Time Lmit Exceeded [2] // Problem 1507. Difficult Decision 7 Nov 2006 00:18
Try use express method (for example A^5 = (A^2)^2*A
Hayk THANK YOU // Problem 1507. Difficult Decision 12 Nov 2006 22:57
Thank you my Friend!
AC.

Ti daril mne RADOST' (I eto v jizni glavnoe)...:)
Neizvestnii Re: Time Lmit Exceeded // Problem 1507. Difficult Decision 22 Jun 2007 21:09
But erection of a matrix in a square borrows n^3. => O(2n*(n^2)*n^3) and this had TL(((
Maybe erection of a matrix in a square can work more quickly?

Edited by author 16.09.2007 14:32
Denis Koshman Re: To test makers // Problem 1507. Difficult Decision 13 Jul 2008 19:31
Anton [SUrSU] wrote 1 November 2006 22:14
I add this code to my last solution and got AC...
  if (n * (n - 1) == 0) {
    cur = e;
    ok = 1; // Yes
  }

It's strange becanse N>=2 according to problem statement