Zepto Code Rush 2014 A. Feed with Candy】的更多相关文章

此题用贪心求解, 首先将caramel drop类别的糖果按照高度从小到大排序,如果高度相同,按照重量从小到大排序 将fruit drop类别的糖果按照高度从小到大排序,如果高度相同,按照重量从小到大排序 现在有两种可能 第一种可能是第一个获得的糖果是caramel drop, 则先搜索caramel drop类别的,然后找到高度小于x的最大高度的index,则在0~index索引之间的高度都小于x,则搜索0~index之间的mass最大的,这样之后高度变得最大,计数值加1,更新x 在搜索fru…
注意题目给的是一个nxm的park,设元素为aij,元素aij 有4种可能U(上移),D(下移),L(左移),R(右移) 假设第i行第j列元素aij(注意元素的索引是从0开始的) 当aij为D时,此时spiders一直往下移动不可能与Om Nom相遇 当aij为U时,此时spiders向上移动时此时Norm与spider初始位置之间距离是i+1,注意索引是从0开始的 如果i为偶数,i+1为奇数则两者必能在i/2位置相遇 如果i为奇数,当Norm在i/2,sprider在i/2+1,移动时,Nor…
这题给的一个教训:Codeforces没有超时这个概念.本来以为1000*(1000+1)/2*10*10要超时的.结果我想多了. 这题由于k层都可能有关系,所以建一个图,每两个点之间连边,边权为n*m和他们之间的差值*w的最小值,然后求一个最小生成树就可以得出结果.且可以证明不会存在环.由于边比较稠密,用Prim算法求最小生成树. 代码: #include <iostream> #include <cstdio> #include <cstring> #include…
Om Nom and Spiders time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a…
题目链接 题意: k个点,每一个点都是一个n * m的char型矩阵.对与每一个点,权值为n * m或者找到一个之前的点,取两个矩阵相应位置不同的字符个数乘以w.找到一个序列,使得全部点的权值和最小 分析: 首先,这个图是一个无向图.求权值和最小,每一个权值相应的是一条边,且每一个点仅仅能有一个权值即一条边,一个k个边,和生成树非常像,可是须要证明不能有环形.最好还是如果如今有三个点,每一个点的最小边成环,这时候是不能找到一个序列使得每一个点都取到它的最小边值的,所以,k个点k个边不能有环且边值…
A. Feed with Candy time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The hero of the Cut the Rope game is a little monster named Om Nom. He loves candies. And what a coincidence! He also is…
code rush 是微软推出的一款VS2008上的插件.他有强大的文件和代码导航功能,易于访问的重构和代码创建功能.一组编辑器.选择.剪贴板工具等. 教程链接 http://www.devexpresscn.com/Resources/CodeExamples-314.html http://www.devexpresscn.com/Resources/Documentation-316.html 下面的是单键模板. Most of these have narrow contexts ass…
拿下 ABD, 顺利晋级, 预赛的时候C没有仔细想,推荐C题,一个非常不错的构造题目! A Magic Trick 简单的题目来取得集合的交并 1: #include <iostream> 2: #include <algorithm> 3: #include <set> 4: #include <vector> 5: using namespace std; 6: int main() 7: { 8: freopen("A-small-attem…
C. Om Nom and Candies Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/526/problem/C Description A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him…
Problem A permutation of size N is a sequence of N numbers, each between 0 and N-1, where each number appears exactly once. They may appear in any order. There are many (N factorial, to be precise, but it doesn't matter in this problem) permutations…
Problem Shota the farmer has a problem. He has just moved into his newly built farmhouse, but it turns out that the outlets haven't been configured correctly for all of his devices. Being a modern farmer, Shota owns a large number of smartphones and…
This problem is the hardest problem to understand in this round. If you are new to Code Jam, you should probably try to solve the other problems first. Problem Naomi and Ken sometimes play games together. Before they play, each of them gets Nidentica…
Introduction Cookie Clicker is a Javascript game by Orteil, where players click on a picture of a giant cookie. Clicking on the giant cookie gives them cookies. They can spend those cookies to buy buildings. Those buildings help them get even more co…
题目链接:http://codeforces.com/contest/436/problem/A 题目意思:给出 n 颗只有两种类型:fruit 和 caramel的candies,这些candies是挂在屋子上的,对于第 i 颗candy,它离地面为 hi 厘米,质量为 mi:有只叫Om Nom的怪兽想尽可能地把这些candy吃光,它初始的时候只能跳 x 的高度,如果有某颗或者一些candy离地面的距离 <= x,就代表Om Nom可以吃掉,吃掉之后它下一次可以跳的高度会变成 x + mi(m…
传送门 C. Om Nom and Candies time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that r…
二进制数位DP,涉及到数字的按位与操作. 查看官方解题报告 #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; #define MAX_LEN 50 long long A, B, K; int a[MAX_LEN], b[MAX_LEN], k[MAX_LEN]; ][][]; void input() { scan…
拖了好久的题解,想想还是补一下吧. A. King of Thieves 直接枚举起点和5个点之间的间距,进行判断即可. #include <bits/stdc++.h> using namespace std; ]; int main() { //freopen("in.txt", "r", stdin); int n; bool ans = false; scanf("%d%s", &n, s); ; q < n &…
A 题意:给出一串由.*组成的字符串,如果有等间距的五个及五个以上的*存在,则输出yes 直接枚举就可以了 看题一定要仔细啊,做的时候看成必须有五个等间距的".*"才可以跳跃= = 然后就这样写居然过了预测= =后来果然被hack了 #include<iostream> #include<cstdio> #include<cstring> #include <cmath> #include<stack> #include<…
D. Om Nom and Necklace time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day Om Nom found a thread with n beads of different colors. He decided to cut the first several beads from this th…
B. Om Nom and Dark Park Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/526/problem/B Description Om Nom is the main character of a game "Cut the Rope". He is a bright little monster who likes visiting friends living a…
A. King of Thieves Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/526/problem/A Description In this problem you will meet the simplified model of game King of Thieves. In a new ZeptoLab game called "King of Thieves" y…
第一次参加ACM竞赛,对自己取得的成绩还满意. Round1A: Rank: 2446 Score: 9 (没有进前1000名,只能拼下次了) Round1B: Rank: 944 Score: 42(太幸运了,从300多降到900多,还好没有出1000) Round1C: 实习老大强势归来,没有时间再搞ACM了,该被老大虐了. Round2: Rank: 2369 Score: 13 (周杰伦与费玉清的千里之外,再也不唱了) Round2 国人成绩总结: 001-100:17人 101-200…
题目描述: 有一天,欧姆诺姆发现了一串长度为n的宝石串,上面有五颜六色的宝石.他决定摘取前面若干个宝石来做成一个漂亮的项链. 他对漂亮的项链是这样定义的,现在有一条项链S,当S=A+B+A+B+A+...+A+B+A的时候是漂亮的,这儿A,B是一些宝石串,“+”表示连接操作.S中有k+1个A和k个B组成.A和B可能是空串. 现在给出宝石串,问怎么切前几个才能得到一个漂亮的宝石项链.他切下来之后不会改变宝石的顺序. 样例解释: 在这个样例中前6个可以组成漂亮的串( A="", B=&qu…
Problem A tree is a connected graph with no cycles. A rooted tree is a tree in which one special vertex is called the root. If there is an edge between X and Y in a rooted tree, we say that Y is a child of X if X is closer to the root than Y (in othe…
Problem Minesweeper is a computer game that became popular in the 1980s, and is still included in some versions of the Microsoft Windows operating system. This problem has a similar idea, but it does not assume you have played Minesweeper. In this pr…
Om Nom is the main character of a game "Cut the Rope". He is a bright little monster who likes visiting friends living at the other side of the park. However the dark old parks can scare even somebody as fearless as Om Nom, so he asks you to hel…
Zepto Code Rush 2014:http://codeforces.com/problemset/problem/436/C 题意:k个点,每个点都是一个n * m的char型矩阵.对与每个点,权值为n * m或者找到一个之前的点,取两个矩阵对应位置不同的字符个数乘以w.找到一个序列,使得所有点的权值和最小. 题解:很明显的最小生成树.但是要加入一个0点,边权为n*m,其余k个点两两建立一条边,边权是diff[i][j]*w,最后这一题,我要死掉的地方就是输出,不仅要输出费用,还要输出…
Google Code Jam 2014 Round 1B Problem B hdu 2089 hdu 3555 uestc 250 (原1307) hdu 3652 hdu 3709 Light OJ 1140 Light OJ 1032 Codeforces 55D poj 3252 Light OJ 1068…
一.IndentGuide 缩进线插件:每个缩进块首尾添加虚线,使代码看着整洁. 其他插件:继续推荐几款VisualStudio的插件 二.CodeRush code rush 是微软推出的一款VS2008上的插件.他有强大的文件和代码导航功能,易于访问的重构和代码创建功能.一组编辑器.选择.剪贴板工具等.CodeRush是一个Visual Studio® .NET 插件,它利用整合技术,通过促进开发者和团队效率来提升开发者体验. 详细说明…
瀑布流布局的特征: 1,各列的高度参差不齐 2,页面向下滚动时,自动请求和加载新数据 目前,瀑布流布局的主流实现方式有两种: 1,基于浮动,每一列是一个ul,这些ul都向左浮动,这种方法的好处是布局容易,加载较为复杂: 2,基于绝对定位,只有一个ul,所有item都加入该ul中,ul相对定位,item绝对定位,所有图片的宽度已知,所有图片的高度信息使用一个数组记录所有图片的高度(即offsetHeight信息). 一.基于浮动的瀑布流布局 基于浮动瀑布流布局的html页面 <!DOCTYPE h…