Shaass has decided to hunt some birds. There are n horizontal electricity wires aligned parallel to each other. Wires are numbered 1 to nfrom top to bottom. On each wire there are some oskols sitting next to each other. Oskol is the name of a delicio…
/////////////////////////////////////////////////////////////////////////////////////////////////////// 作者:stxy-ferryman声明:本文遵循以下协议自由转载-非商用-非衍生-保持署名|Creative Commons BY-NC-ND 3.0 查看本文更新与讨论请点击:http://www.cnblogs.com/stxy-ferryman/链接被删请百度:stxy-ferryman…
In the city of Ultima Thule job applicants are often offered an IQ test. The test is as follows: the person gets a piece of squared paper with a 4 × 4 square painted on it. Some of the square's cells are painted black and others are painted white. Yo…
A. Shaass and Oskols 模拟. B. Shaass and Bookshelf 二分厚度. 对于厚度相同的书本,宽度竖着放显然更优. 宽度只有两种,所以枚举其中一种的个数,另一种的个数是单调的. C. Shaass and Lights 考虑一段连续未点亮的灯,显然每次操作都只会将区间长度减一,继而推得长度L的方案数为\(2^{L - 1}\)种. 考虑有若干段Li合并,对于一个区间来说,内部的操作顺序应该是相对不变的,那么就是挖空填即可. 注意判断两端的状态,即考虑1.n的状…
A - Shaass and Oskols Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 294A Description Shaass has decided to hunt some birds. There are n horizontal electricity wires aligned parallel to…
这道题目的意思就是排两排书,下面这排只能竖着放,上面这排可以平着放,使得宽度最小 根据题意可以得出一个结论,放上这排书的Width 肯定会遵照从小到大的顺序放上去的 Because the total thickness of vertical books is fixed it's good to calculate the minimum possible total width of horizontal books. 那么只需要模拟一遍放书的过程即可,不会TLE 不过正统解法是Dp Dp…
题目连接:http://codeforces.com/contest/676/problem/B 题意:给你一个N层的杯子堆成的金字塔,倒k个杯子的酒,问倒完后有多少个杯子的酒是满的 题解:由于数据不是很大,直接模拟就行了 #include<cstdio> #include<cstring> #define F(i,a,b) for(int i=a;i<=b;++i) ][],eps=1e-,p;int n,k,ans; void fuck(){ a[][]+=; F(i,,…
题目大意:给你一段内存,要你进行如下的三个操作. 1.分配内存  alloc   X ,分配连续一段长度为X的内存. 如果内存不够应该输出NULL,如果内存够就给这段内存标记一个编号. 2.擦除编号为 X的内存,erase X,  如果这段内存不存在那么输出“ILLEGAL_ERASE_ARGUMENT ”,否则什么都不输出. 3.整理内存,把所有的内存块整理到一块.   #include<cstdio> #include<cstring> #include<iostream…
 Devu and Partitioning of the Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Devu being a small kid, likes to play a lot, but he only likes to play with arrays. While playing he came…
题目链接:Kilani and the Game 题目原文 Kilani is playing a game with his friends. This game can be represented as a grid of size…