Appleman and a Sheet of Paper】的更多相关文章

C. Appleman and a Sheet of Paper   Appleman has a very big sheet of paper. This sheet has a form of rectangle with dimensions 1 × n. Your task is help Appleman with folding of such a sheet. Actually, you need to perform q queries. Each query will hav…
题意: 给一纸条,两种操作: 1.将左侧长度为$x$的纸条向右翻折. 2.询问位于$[l,r]$的纸条总长度. 解法: 考虑启发式,每一次一个小纸条折叠我们可以看做是一次合并,如果我们每一次将较小的纸条并入较大的纸条. 这样对于每一个数字,包含它的纸条长度每次至少乘以2,这样每一个数字变动$logn$次. 对于一个$2x > len$过大的操作,我们可以转化为将右面的$len-x$个翻折过来,并执行一次翻转操作. 用$rev$记录是否翻转,分类讨论即可. 同时用线段树记录区间和. 这样总效率$O…
Discription Yuuko and Nagi like to play the following game: Initially they take a checkered sheet of paper of the size of N x M cells. Then, one cell, let's call this cell (X, Y) is marked. Then, they take the moves alternately. A move consists of ma…
1. CF 438D The Child and Sequence 大意: n元素序列, m个操作: 1,询问区间和. 2,区间对m取模. 3,单点修改 维护最大值, 取模时暴力对所有>m的数取模. 因为取模后至少减半, 复杂度$O(nlognlogC)$ 2. CF 431E Chemistry Experiment 大意: n个试管, 第$i$个试管有$a_i$单位水银, m个操作: 1, 修改$a_x$改为$v$. 2, 将$v$单位水倒入试管, 求一种方案使得有水的试管水银与水总量的最大…
http://codeforces.com/contest/462 A:Appleman and Easy Task 要求是否全部的字符都挨着偶数个'o' #include <cstdio> using namespace std; ][]; int n; ][]; ]={,,-,}; ]={,-,,}; int main(){ scanf("%d",&n); gets(maz[]); ;i<n;i++){ gets(maz[i]); } ;i<n;i+…
比赛链接:http://codeforces.com/contest/462 这次比赛的时候,刚刚注冊的时候非常想好好的做一下,可是网上喝了个小酒之后.也就迷迷糊糊地看了题目,做了几题.一觉醒来发现rating掉了非常多,那个心痛啊! 只是.后来认真的读了题目,发现这次的div2并非非常难! 官方题解:http://codeforces.com/blog/entry/13568 A. Appleman and Easy Task 解析:         一个水题,推断每一个细胞周围是否都是有偶数…
This Chapter outlines the logical steps to writing a good research paper. To achieve supreme excellence or perfection in anything you do, you need more than just the knowledge. Like the Olympic athlete aiming for the gold medal, you must have a posit…
Playing with Paper time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm  ×  b mm she…
A. Playing with Paper One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm  ×  b mm sheet of paper (a > b). Usually the first step in making an origami is making a square piece of paper from the…
If a large sheet of paper is folded in half, then in half again, etc, with all the folds parallel, then opened up flat, there are a series of parallel creases, some pointing up and some down, dividing the paper into fractions of the original length.…