Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:为什么一定要拆牛?将食物放左,牛放中间,水放右边为什么不能AC求指教???

Posted by dongshanluo at 2011-09-19 22:46:18 on Problem 3281 and last updated at 2011-09-19 22:50:31
In Reply To:为什么一定要拆牛?将食物放左,牛放中间,水放右边为什么不能AC求指教??? Posted by:X2nes at 2011-08-12 15:52:39
WA了之后打印出矩阵我才看出来这么做是错的。。
比如只有1条牛,1 2 两种食物,1 2两种水

那图会是下边那样的

食物1           食物2
  |               |
  |               |
   -----> 牛 <----
         / \
        /   \
  水1<--|    |-------> 水2

对应的输入数据是

1 2 2
2 2 1 2 1 2
这时候就真的2了WA了
拆成下边那样就没事了

食物1           食物2
  |               |
  |               |
   --> 牛1<------
         /
        /
        \
        |-->还是牛1
           / \
          /   \
    水1<--|    |-----> 水2


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator