Welcome![Sign In][Sign Up]
Location:
Downloads SourceCode Windows Develop Other
Title: NA_3_02 Download
 Description: For solving the following problem: "There is No Free Lunch" Time Limit: 1 Second Memory Limit: 32768 KB One day, CYJJ found an interesting piece of commercial from newspaper: the Cyber-restaurant was offering a kind of "Lunch Special" which was said that one could "buy one get two for free". That is, if you buy one of the dishes on their menu, denoted by di with price pi , you may get the two neighboring dishes di-1 and di+1 for free! If you pick up d1, then you may get d2 and the last one dn for free, and if you choose the last one dn, you may get dn-1 and d1 for free. However, after investigation CYJJ realized that there was no free lunch at all. The price pi of the i-th dish was actually calculated by adding up twice the cost ci of the dish and half of the costs of the two "free" dishes. Now given all the prices on the menu, you are asked to help CYJJ find the cost of each of the dishes.
 Downloaders recently: [More information of uploader chenxiang]
  • [eightqueen] - 8 Queen
  • [IP_Setting] - Summer bedroom laboratory to run every d
  • [Newton_s_Method] - A program for solving equations using Ne
  • [ew] - for: Root of a Polynomial---------------
  • [homepage] - Using extjs in a personal home page code
File list (Check if you may need any files):
NA_3_02.c
    

CodeBus www.codebus.net