字符串
文章平均质量分 89
七情六欲·
唔西迪西 糊不拉几
展开
-
UVA - 220 Othello
Othello is a game played by two people on an 8 x 8 board, using disks that are white on one side andblack on the other. One player places disks with the white side up and the other player places diskswith the black side up. The players alternate placing原创 2021-01-11 22:10:25 · 180 阅读 · 0 评论 -
UVA - 1587 Box
Ivan works at a factory that produces heavy machinery. He has a simple job — he knocks up woodenboxes of different sizes to pack machinery for delivery to the customers. Each box is a rectangularparallelepiped. Ivan uses six rectangular wooden pallets to原创 2021-01-11 13:50:01 · 120 阅读 · 0 评论 -
UVA - 227 Puzzle
A children’s puzzle that was popular 30 years ago consisted of a 5×5 frame which contained 24 smallsquares of equal size. A unique letter of the alphabet was printed on each small square. Since therewere only 24 squares within the frame, the frame also c原创 2021-01-11 13:32:34 · 113 阅读 · 0 评论 -
UVA - 340 Master-Mind Hint
MasterMind is a game for two players. One of them, Designer, selects a secret code. The other, Breaker,tries to break it. A code is no more than a row of colored dots. At the beginning of a game, the playersagree upon the length N that a code must have a原创 2021-01-10 17:14:25 · 96 阅读 · 0 评论 -
ICPC Arab Collegiate Programming Contest 2014
给N个密码,密码 A 和密码 B 如果长度相同,而且对于每个位置 i ,都有 | A[i] - B[i] |相同,那么则称密码 A 和密码 B 是等价的。输入密码时会跳过和之前输入过密码相等价的密码。求最多要按顺序输入多少个密码。解题思路:模拟即可(确信)。其实上只需高效判断当前密码是否有相等价的被输入了即可。换个角度考虑,输入了一个新密码的之后,我们会跳过所有与它等价的密码。所以,我们不妨同时也“输入”所有与它等价的密码,然后在之后即容易判断当前密码是否有与它等价的密码被输入过了。如何枚举所有与原创 2020-07-29 20:57:12 · 314 阅读 · 0 评论 -
UCF Local Programming Contest 2019(Practice)
今天是 信息工程大学 主持比赛,有几个非常好的题,但是剩下的就是水题 哈哈????????????????先发一个让我吐了的题Spell CheckerThis question is about automatic spelling correction. Studies have shown that the majority of typing errors are caused by (let’s assume the dictionary contains the word “these”原创 2020-07-25 12:51:45 · 423 阅读 · 0 评论 -
POJ 3461 Oulipo
OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 62133 Accepted: 23967DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter ‘e’. He was a member of the Oulipo group. A quote from t原创 2020-07-23 16:59:50 · 149 阅读 · 0 评论 -
HDU 3613 Best Reward
Best RewardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 6830 Accepted Submission(s): 2807Problem DescriptionAfter an uphill battle, General Li won a great victory. Now the head of state deci原创 2020-07-23 16:02:26 · 118 阅读 · 0 评论 -
HDU 4080 Stammering Aliens
Stammering AliensTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3025 Accepted Submission(s): 957Problem DescriptionDr. Ellie Arroway has established contact with an extraterrestrial civilizat原创 2020-07-21 23:29:20 · 283 阅读 · 0 评论 -
A - Palindrome
Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, “Can you propose an efficient algorithm to find the length of the largest palindrome in a string?”A string is said to be a p原创 2020-07-21 13:03:50 · 289 阅读 · 0 评论 -
第七十九题 UVa1368 DNA Consensus String
DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four differentnucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in Figure 1. If ...原创 2020-02-05 13:04:07 · 166 阅读 · 0 评论 -
第七十七题 UVa10082 WERTYU
还是水题但是有两个CLion的小问题搞得我好难受【题目大意】对于每个字符,输出它在键盘上左边的字符//// Created by DELL on 2020/2/4.//代码是很简单 另外写一篇关于CLion的小博客 可以去看 最近发现处理的问题#include <iostream>#include <cstring>#include <...原创 2020-02-04 13:26:37 · 149 阅读 · 0 评论 -
第七十六题 UVa272 TEX Quotes
最近几天学不下习去,很烦躁,昨天晚上和学长聊了很多,他给了我一个网址,上面是紫书的例题,并且按照紫书的顺序,听学长的 我还是从第三章开始一点点刷题吧,不管他简单与否TEX is a typesetting language developed by Donald Knuth. It takes source text together with a fewtypesetting instruc...原创 2020-02-04 12:53:10 · 162 阅读 · 0 评论 -
第七十二题 UVA10340 子序列 All in All
You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss...原创 2020-01-31 21:58:39 · 186 阅读 · 0 评论 -
第六十三题 UVA506 系统依赖 System Dependencies
题意翻译你的任务是模拟安装和卸载软件组件的过程。指令如下:指令 说明 DEPEND item1 item2 [item3..] item1 依赖 item2,item3..(保证不存在循环依赖) INSTALL item1 安装item1及其依赖(不必重复安装) REMOVE item1 卸载item1及其依赖(不能卸载 还被其他显式安装...原创 2020-01-27 11:53:26 · 220 阅读 · 0 评论 -
BZOJ 1030 文本生成器
1030: [JSOI2007]文本生成器 Time Limit: 1 Sec Memory Limit: 162 MB Submit: 4777 Solved: 1986 [Submit][Status][Discuss] Description JSOI交给队员ZYX一个任务,编制一个称之为“文本生成器”的电脑软件:该软件的使用者是一些低幼人群, 他们现在使用的是GW文本生成原创 2017-07-31 15:41:01 · 227 阅读 · 0 评论 -
第七题 UVa1593 代码对齐 Alignment of Code
PDFYou are working in a team that writes Incredibly Customizable Programming Codewriter (ICPC) whichis basically a text editor with bells and whistles. You are working on a module that takes a piece...原创 2020-01-01 14:35:27 · 130 阅读 · 0 评论 -
洛谷 字符串&&数论 水一波
题目背景现代的人对于本家族血统越来越感兴趣。题目描述给出充足的父子关系,请你编写程序找到某个人的最早的祖先。输入输出格式输入格式: 输入由多行组成,首先是一系列有关父子关系的描述,其中每一组父子关系中父亲只有一行,儿子可能有若干行,用#name的形式描写一组父子关系中的父亲的名字,用+name的形式描写一组父子关系中的儿子的名字;接下来用?name的形式表示要求该人的最早的祖先;最后用单独的一个$原创 2017-06-21 15:42:44 · 964 阅读 · 0 评论 -
HDU 2896 病毒侵袭
病毒侵袭Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description 当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~ 但网路原创 2017-07-13 17:17:15 · 250 阅读 · 0 评论 -
51Nod 1873 初中的算术
1873 初中的算术基准时间限制:1 秒 空间限制:131072 KB Noder现在上初三了,正在开始复习中考。他每天要计算型如 (a× a× a× ⋯× a)n个a 的式子。 其中 0.0//刚开始想用高精度写,难写,而且貌似会T,看了题解之后真的是涨姿势啊//string还能这么玩#include<bits/stdc++.h>using namespace std;string mu原创 2017-07-19 08:52:16 · 744 阅读 · 0 评论 -
BZOJ 3555 CTSC2014 企鹅QQ
题目大意:给定n个不相同的字符串,问有多少对字符串只差一个字母 枚举每个只差一个字母的位置,取除这个字符以外的哈希值判断即可#include<iostream>#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>using namespace std;#define MAXN 30010#defin原创 2017-08-12 11:36:46 · 321 阅读 · 0 评论 -
POJ 3461 Oulipo
Oulipo Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 42555 Accepted: 17085 Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, withou原创 2017-08-13 10:37:53 · 290 阅读 · 0 评论 -
洛谷 P1210 回文检测
题目描述 据说如果你给无限只母牛和无限台巨型便携式电脑(有非常大的键盘),那么母牛们会制造出世上最棒的回文。你的工作就是去寻找这些牛制造的奇观(最棒的回文)。 在寻找回文时不用理睬那些标点符号、空格(但应该保留下来以便做为答案输出),只用考虑字母’A’-‘Z’和’a’-‘z’。要你寻找的最长的回文的文章是一个不超过20,000个字符的字符串。我们将保证最长的回文不会超过2,000个字符(在除去标原创 2017-10-17 17:41:31 · 497 阅读 · 0 评论 -
洛谷 P2543 [AHOI2004]奇怪的字符串
题目描述 输入输出格式 输入格式: 输入文件中包含两个字符串X和Y。当中两字符串非0即1。序列长度均小于9999。 输出格式: X和Y的最长公共子序列长度。 输入输出样例 输入样例#1: 01010101010 00000011111 输出样例#1: 6 输入样例#2: 01011 010010101111111111 输出样例#2: 5//少年 别多想 怼#inc原创 2017-10-17 19:51:44 · 933 阅读 · 0 评论 -
51Nod 1732 51nod婚姻介绍所
1732 51nod婚姻介绍所题目来源: 原创基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注51nod除了在做OJ之外,还开展了很多副业。婚姻介绍所就是其中之一。对于一个客户,我们可以使用一个字符串来描述该客户的特质。假设现在我们有两个客户A和B。原创 2017-10-22 21:39:58 · 258 阅读 · 0 评论 -
洛谷 P2679子串
题目背景 无 题目描述 有两个仅包含小写英文字母的字符串 A 和 B。现在要从字符串 A 中取出 k 个互不重叠的非空子串,然后把这 k 个子串按照其在字符串 A 中出现的顺序依次连接起来得到一 个新的字符串,请问有多少种方案可以使得这个新串与字符串 B 相等?注意:子串取出 的位置不同也认为是不同的方案。 输入输出格式 输入格式: 输入文件名为 substring.in。 第一行是三原创 2017-09-09 20:02:49 · 321 阅读 · 0 评论 -
Day 2 整理
AC自动机 KMP在Trie上的完美运用,在Trie树上构建fail指针 AC自动机的构造: 1.构造一棵Trie,作为AC自动机的搜索数据结构。 2.构造fail指针,使当前字符失配时跳转到具有最长公共前后缀的字符继续匹配。如同 KMP算法一样, AC自动机在匹配时如果当前字符匹配失败,那么利用fail指针进行跳转。由此可知如果跳转,跳转后的串的前缀,必为跳转前的模式串的后缀并且跳转的新位原创 2017-05-04 20:33:23 · 225 阅读 · 0 评论