Ejemplo n.º 1
0
    private static void Main()
    {
        while (true)
        {
            int[] line        = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int   partyBudget = line[0];
            int   partyCount  = line[1];
            if (partyBudget == 0 && partyCount == 0)
            {
                return;
            }

            int[,] parties = new int[partyCount, 2];
            for (int i = 0; i < partyCount; ++i)
            {
                line          = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                parties[i, 0] = line[0]; // entrance fee
                parties[i, 1] = line[1]; // fun value
            }

            var result = PARTY.Solve(partyBudget, partyCount, parties);
            Console.WriteLine($"{result.Item1} {result.Item2}");

            Console.ReadLine();
        }
    }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            PARTY pARTY = db.PARTY.Find(id);

            db.PARTY.Remove(pARTY);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Id,party1")] PARTY pARTY)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pARTY).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pARTY));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "Id,party1")] PARTY pARTY)
        {
            if (ModelState.IsValid)
            {
                db.PARTY.Add(pARTY);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pARTY));
        }
Ejemplo n.º 5
0
        // GET: PARTies/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PARTY pARTY = db.PARTY.Find(id);

            if (pARTY == null)
            {
                return(HttpNotFound());
            }
            return(View(pARTY));
        }