C. Vanya and Label 题目连接: http://www.codeforces.com/contest/677/problem/C Description While walking down the street Vanya saw a label "Hide&Seek". Because he is a programmer, he used & as a bitwise AND for these two words represented as a…
A. Vanya and Fence 题目连接: http://www.codeforces.com/contest/677/problem/A Description Vanya and his friends are walking along the fence of height h and they do not want the guard to notice them. In order to achieve this the height of each of the frien…
啊啊啊啊啊啊啊,真的是智障了... 这种题目,没有必要纠结来源.只要知道它的结果的导致直接原因?反正这句话就我听的懂吧... ">>"/"&" #include<cstdio> int main() { int ans=1; for(int i=0;i<=1;i++) printf("%d\n",ans&i); ans=0; for(int i=0;i<=1;i++) printf("…
D. Vanya and Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/problem/D Description Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as…
A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of…
Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/A Description After a hard day Vitaly got very hungry and he wants to eat his favorite pot…
B. Vanya and Food Processor 题目连接: http://www.codeforces.com/contest/677/problem/B Description Vanya smashes potato in a vertical food processor. At each moment of time the height of the potato in the processor doesn't exceed h and the processor smash…
A. Fox And Snake 题目连接: http://codeforces.com/contest/510/problem/A Description Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead. A sna…
A. Vasya the Hipster Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/problem/A Description One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks. Accordi…
B. Anatoly and Cockroaches 题目连接: http://codeforces.com/contest/719/problem/B Description Anatoly lives in the university dorm as many other students do. As you know, cockroaches are also living there together with students. Cockroaches might be of tw…
A. Brain's Photos 题目连接: http://www.codeforces.com/contest/707/problem/A Description Small, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but t…
A. Free Ice Cream 题目连接: http://www.codeforces.com/contest/686/problem/A Description After their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice cream to kids in the summer. At the start of the day they hav…
D. Vanya and Treasure 题目连接: http://www.codeforces.com/contest/677/problem/D Description Vanya is in the palace that can be represented as a grid n × m. Each room contains a single chest, an the room located in the i-th row and j-th columns contains t…
题目链接: http://codeforces.com/contest/677/problem/D 题意: 让你求最短的从start->...->1->...->2->...->3->...->...->p的最短路径. 题解: 这题dp的阶段性还是很明显的,相同的值得方格为同一个阶段,然后求从阶段1->2->3...->p的阶段图最短路. 初始化所有a[x][y]==1的格子为起始点到(x,y)坐标的距离. 方程式为dp[x1][y1…
B. Vanya and Food Processor time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output ->  Link  <- cf上的题果然很靠思路,这让我想起了学长说的那句话:每A完CF上的一套题都有不同的收获. 这道题题意倒是不难理解:有一台机器,每次只能处理K cm的土豆,这台机器最多能放下hcm的土豆,如果剩下的土…
题目大意: 给你一个n × m 的图,有p种宝箱, 每个点上有一个种类为a[ i ][ j ]的宝箱,a[ i ][ j ] 的宝箱里有 a[ i ][ j ] + 1的钥匙,第一种宝箱是没有锁的, 第p类宝箱只有一个且里面由宝藏,你现在在(1 ,1)问你最少需要多少步才能拿到宝藏. (n, m <= 300) 思路:这题真的好恶心啊...  我们考虑p类宝箱只能从p - 1类转移过来, 这样我们就能从第一类宝箱开始往后递推, 但是最坏的情况, p 类 和p - 1类,都有45000 个点, 那…
菜菜菜!!!这么撒比的模拟题,听厂长在一边比比比了半天,自己想一想,然后纯模拟一下,中间过程检测一下,妥妥的就可以过. 题意:有N个东西要去搞碎,每个东西有一个高度,然后有一台机器支持里面可以达到的最大高度,东西可以连续放进去,只要不超过h就行了,每秒可以搞k高度,然后让你算时间 直接code: #include<cstdio> #include<vector> #include<string.h> #include<iostream> #include&l…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud 本场题目都比较简单,故只写了E题. E. Vanya and Field Vanya decided to walk in the field of size n × n cells. The field contains m apple trees, the i-th apple tree is at the cell with coordinates(xi, yi). Van…
E. Vanya and Field time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya decided to walk in the field of size n × n cells. The field contains m apple trees, the i-th apple tree is at the c…
A. Vladik and flights 题目链接 http://codeforces.com/contest/743/problem/A 题面 Vladik is a competitive programmer. This year he is going to win the International Olympiad in Informatics. But it is not as easy as it sounds: the question Vladik face now is…
D. Anton and Chess 题目连接: http://codeforces.com/contest/734/problem/D Description Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game on 8 to 8 board to…
B. Anton and Digits 题目连接: http://codeforces.com/contest/734/problem/B Description Recently Anton found a box with digits in his room. There are k2 digits 2, k3 digits 3, k5 digits 5 and k6 digits 6. Anton's favorite integers are 32 and 256. He decide…
A. Anton and Danik 题目连接: http://codeforces.com/contest/734/problem/A Description Anton likes to play chess, and so does his friend Danik. Once they have played n games in a row. For each game it's known who was the winner - Anton or Danik. None of th…
B. Gena's Code 题目连接: http://www.codeforces.com/contest/614/problem/B Description It's the year 4527 and the tanks game that we all know and love still exists. There also exists Great Gena's code, written in 2016. The problem this code solves is: give…
A. Link/Cut Tree 题目连接: http://www.codeforces.com/contest/614/problem/A Description Programmer Rostislav got seriously interested in the Link/Cut Tree data structure, which is based on Splay trees. Specifically, he is now studying the expose procedure…
A. Saitama Destroys Hotel 题目连接: http://www.codeforces.com/contest/608/problem/A Description Saitama accidentally destroyed a hotel again. To repay the hotel company, Genos has volunteered to operate an elevator in one of its other hotels. The elevato…
B. Pasha and Tea Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/B Description Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and…
A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/A Description Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there. At a meeting of the jury…
C. String Manipulation 1.0 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/555/problem/A Description Andrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhibition of cont…
B. Strings of Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/problem/B Description Volodya likes listening to heavy metal and (occasionally) reading. No wonder Volodya is especially interested in texts concerning…