Candy Treasure Box】的更多相关文章

This is an interesting puzzle game. In the game, you need to use your brain, think carefully, operate reasonably, point your fingers to catch things, and don't miss those who like the puzzle games~…
A. Stock Market 枚举哪一天买入,哪一天卖出即可. #include<cstdio> #include<algorithm> using namespace std; typedef long long ll; const int P=1000000; int T,n,i,a[111],j,ans,m; int main(){ scanf("%d",&T); while(T--){ scanf("%d%d",&n…
Earthstone Keeper Time Limit: 4 Seconds      Memory Limit: 65536 KB Earthstone Keeper is a famous roguelike game created by Lizard Entertainment. In this game, an adventurer will explore in a single layer dungeon of N × M size. The adventurer starts…
E. Clockwork Bomb 题目连接: http://www.codeforces.com/contest/650/problem/E Description My name is James diGriz, I'm the most clever robber and treasure hunter in the whole galaxy. There are books written about my adventures and songs about my operations…
题目描述: 给出N个盒子(N<=100),每个盒子有一定数量的糖果(每个盒子的糖果数<=100),现在有q次查询,每次查询给出两个数k,m,问的是,如果从N个盒子中最多打开k个盒子(意思是打开1~k个盒子)能否使得糖果的总数恰好等于m,如果可以则输出Yes,否则输出No 题目分析: 对于普通的0-1背包我们经过优化之后用一个一维数组dp[j]表示的是前i个物品,容量为j时的可以获得的最大的价值,但是本题有些不同的是,我们求的dp[j]表示的是前i个盒子,容量恰好为j时,可以选择打开的盒子的最少…
题意:你有\(n\)个礼物,礼物有自己的种类,你想将它们按种类打包送人,但是打包的礼物数量必须不同(数量,与种类无关),同时,有些礼物你想自己留着,\(0\)表示你不想送人,问你在送出的礼物数量最大的同时,尽可能的使自己喜欢的留下来,输出能送出的最大礼物数,以及这些礼物中自己不喜欢的数目. 题解:首先,我们肯定要让送出的礼物数最大,同时喜欢的最小,也就是送的礼物中,尽量让它的\(f\)是\(1\).这题考虑贪心,我们可以先对礼物数量进行排序,礼物数量相同让\(1\)多的排在前面,全部丢进优先队列…
B题题意: 给你n个物品的价格,你需要找出来一个值b,使得每一个物品与这个b的差值的绝对值小于k.找到最大的b输出,如果找不到,那就输出-1 题解: 很简单嘛,找到上下限直接二分.下限就是所有物品中最小的价格.上限就是所有物品中最大价格加上k 代码: 1 #include<stdio.h> 2 #include<string.h> 3 #include<iostream> 4 #include<algorithm> 5 #include<map>…
C. Inna and Candy Boxes   Inna loves sweets very much. She has n closed present boxes lines up in a row in front of her. Each of these boxes contains either a candy (Dima's work) or nothing (Sereja's work). Let's assume that the boxes are numbered fr…
Eat Candy Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 8  Solved: 6[Submit][Status][Web Board] Description There is a box with infinite volume. At first there are ncandies in the box. Then every second you will eat some candies, left half of candie…
B. Candy Boxes 题目链接:http://codeforces.com/problemset/problem/488/B time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There is an old tradition of keeping 4 boxes of candies in the house in Cy…