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 1344. Gigantic Turnip

2 admins:
Posted by ftc 22 Jun 2008 18:17
Please check test #20 for this problem. It seems to be incorrect. There is a pulley X which is connected to Y, but Y is not connected to X. I think so, because i got WA20, then added such code and got AC.
Code:
for (i = 0; i < n; i++)
    {
        if (blk[i].y > 0)
        {
            int t = blk[i].y - 1;
            if ((blk[t].x1 != i + 1) && (blk[t].y != i + 1) && (blk[t].x2 != i + 1))
            {
                cout << "1.0000";
                return;
            }
        }
        if (blk[i].x1 > 0)
        {
            int t = blk[i].x1 - 1;
            if ((blk[t].x1 != i + 1) && (blk[t].y != i + 1) && (blk[t].x2 != i + 1))
            {
                cout << "1.0000";
                return;
            }
        }
        if (blk[i].x2 > 0)
        {
            int t = blk[i].x2 - 1;
            if ((blk[t].x1 != i + 1) && (blk[t].y != i + 1) && (blk[t].x2 != i + 1))
            {
                cout << "1.0000";
                return;
            }
        }
    }
Test 20 is corrected. Thank you. (-)
Posted by Sandro (USU) 23 Jun 2008 13:47