zoj 1633 Big String】的更多相关文章

Big String Time Limit: 2 Seconds Memory Limit: 65536 KB We will construct an infinitely long string from two short strings: A = "^__^" (four characters), and B = "T.T" (three characters). Repeat the following steps: Concatenate A after…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3702 题目大意: 对于给定的一个字符串,满足如下要求输出AC,否则WA(好吧我简写) 给定字符串只有ZOJ三个字母组成.Z和J只能有一个并且Z在左边 J之后的O个数必须大于Z之前的O个数 Z和J之间O的个数必须不大于J之后的O的个数,并且他们都大于0 #include<cstdio> #include<cstring> const int MAXN=1001;…
迭代 每个数对应前面的一个数 #include<stdio.h> #include<iostream> using namespace std; #define max 88 long long s[max], n,p; char *first="T.T^__^"; void Init() { s[]=; s[]=; int i; ; i <= max; i++) s[i]=s[i-]+s[i-]; } int getp() { ; while(n>…
意甲冠军: 到原始字符串.给n字符串,每个字符串都有一个属性,属性0代表重叠,1代表不能重叠 请各多少次出现的字符串 思维: 为了便于建立两台机器自己主动(0一个.1一个) 然后,它可以重叠非常好做,谁做 不可重叠的话须要记录两个东西 len[i]代表每一个串的长度,used[i]代表每一个串在之前出现的位置,初始化-1 然后遍历到的时候对于当前位置 j. 必须j>=used[i]+len[i] 才干算出现.而且更新 须要注意的是: 会出现相同属性而且相同的串. 我处理的方式就是排序.按id排序…
Searching the String Time Limit: 7 Seconds      Memory Limit: 129872 KB Little jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she often gives jay some dull problems related to string. And one day, m…
ZOJ Problem Set - 3490 String Successor Time Limit: 2 Seconds      Memory Limit: 65536 KB The successor to a string can be calculated by applying the following rules: Ignore the nonalphanumerics unless there are no alphanumerics, in this case, increa…
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=151 For each list of words, output a line with each word reversed without changing the order of the words. This problem contains multiple test cases! The first line of a multiple input is…
点我看题目 题意 : 给你一个字符串,让你按照给定规则进行处理. 如果字符串里有字母或者是数字就忽略非字符数字,如果没有,就让最右边的那个字符+1. 增量都是从最右边的字母或者数字开始的. 增加一个数字的方法是加1到另一个数字('0' -> '1', '1' -> '2' ... '9' -> '0'). 增加一个大写字母的方法是加一位到另一个字母 ('A' -> 'B', 'B' -> 'C' ... 'Z' -> 'A'). 增加一个小写字母的方法是加一位到另一个字…
题目大意:首先给你一下母串,长度不超过10^5,然后有 N(10^5) 次查询,每次查询有两种命令,0或者1,然后加一个子串,询问母串里面有多少个子串,0表示可以重复,1表示不可以重复.   分析:发现查询的次数是比较多的,然后可以利用查询的串建立一个trie,然后用母串跑一遍就行了,不过有两种操作比较麻烦一些,不过我们可以保存查询时每个节点的查询结果,然后每个串都对应一个节点,最后输出查询结果即可,这样也可以规避掉重复串的问题.   代码如下: ========================…
一道模拟题,来模拟进位 暴力的从右往左扫描,按规则求后继就好了.除了Sample已给出的,还有一些需要注意的地方: 9的后继是10,而不是00: (z)的后继是(aa),而不是a(a): 输入虽然最长只有100,但输出最长可能有102. 事实上题目中给的字符串后继规则,也是Ruby中String#succ或String#next所用的规则 http://blog.watashi.ws/1944/the-8th-zjpcpc/ 标程也写的非常好 //#pragma comment(linker,…