http://poj.org/problem?id=1936 1 #include 2 #include 3 #include 4 #define max 100010 5 using namespace std; 6 char s[max],s1[max]; 7 int main() 8 { 9 while(scanf("%s %s",s,s1)!=EOF){10 11 int k1=strlen(s);12 int k2=strlen(s1);13 int t=0,c=0;14 for(int i=0;i<k1;i++...
转载
2013-08-09 21:41:00
124阅读
2评论
All in AllTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 27328 Accepted: 11175Descri
原创
2023-04-20 21:30:43
59阅读
Ubuntu系统的/etc/sudoers里面会默认有“%sudo ALL=(ALL:ALL)”这个字段,意思为sudo组下的所有用户都能使用sudo权限
原创
2022-06-28 20:02:41
961阅读
UVA_10340
我们不妨从左至右依次生成字符串s,这样我们只要依次扫描t,如果当前字符和s中待生成的字符一样,就拿出来生成即可,这样可以保证每个所需字符在t中拿出时的位置都是尽可能靠左的,这样和拿出一个更靠右一点的相同的字符相比,所得到的结果至少不会更差。
#include<stdio.h>
#include<string.h>
#define MAXL 10
转载
2012-11-08 13:51:00
93阅读
2评论
UVA_10340
这个题目只要依次查找s中的字符是否按顺序在t中出现过即可,此外,这个题目如果s和t完全相同的话,也要输出Yes,尽管这样貌似算是没加密过……但毕竟没和题意产生冲突。
#include<stdio.h>#include<string.h>char s[100000],t[100000];int main(){int i,j,k1,k2;while
转载
2011-09-21 13:47:00
105阅读
2评论
题目大意:输入两个字符串,判断第一个字符串是否为第二个字符串的子字符串,即第一个字符串所有字符按顺序在第二个字符串中都有。例如:样例解题思路:第一个字符串a,第二个字符串b,定位到a的头,循环里,每当找到定位的字符与b中的字符相等时,往下移。直到移了a的长度,跳出循环,即a为b的子字符串。解题注意:输出的“Yes”和“No”的大小写。第一次写完的觉得代码还算看的过去,结果W
原创
2021-12-01 16:19:36
301阅读
题目大意:判断一个字符串的所有字符是否都在另
原创
2023-04-07 10:35:14
65阅读
题目链接输入两个字符串s和t,判断是否可以从t中删除0个或多个字符(其他字符顺序不变),得到字符串是。代码:/
原创
2022-07-19 10:16:51
42阅读
DescriptionYou have devised a new encryption technique which encodes a message by inserting between its characters r
原创
2022-05-16 20:55:17
184阅读
You have devised a new encryption technique which encodes a message by inserting between its charactersrandomly generated strings in a clever way. Bec
转载
2019-07-10 01:05:00
119阅读
【简要题意】:鉴于两个字符串s和t,比量s是t子串。长度不超过100000.【分析】:它简单的模拟。。// 368K 16Ms#include#includeusing namespace std;int main(){ int i,j; char s[100000],t[100000]; whi...
转载
2015-10-01 20:37:00
112阅读
2评论
验证第二个字符串删去若干个字符后能否得到第一个字符串逐个去匹配即可只不过思维还不够严密,WA了几次开始 1 //#define LOCAL 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = 100000 + 10...
转载
2014-08-26 08:37:00
85阅读
2评论
题目链接:点击打开链接
题意:从字符串t中找字符串s,只要字符串t中有字符串s的所有字符并且是字符s的顺序就行,详情看代码
#include
原创
2022-09-07 16:34:09
22阅读
将用户添加到sudoer列表
默认情况下,linux没有将当前用户列入到sudoer列表中(在redhat系列的linux发行版中最为常见),这时如果你使用sudo来执行某些命令的话,就会提示你该用户不再sudoer列表中。这时,我们就需要手工加入了。
1.在命令行下键入:$su ,并输入root账户的密码,切换到root账户,其中的$是命令提示符,不用你敲
2.命令行键入:#visudo
转载
2021-02-04 10:44:00
493阅读
2评论
一.文本设置1、font-size: 字号参数 2、font-style: 字体格式3、font-weight: 字体粗细4、颜色属性color: 参数注意使用网页安全色 二、超链接设置text-decoration: 参数主要用途是改变浏览器显示文字链接时的下划线。 参数取值范围: underli ...
转载
2021-10-29 23:15:00
85阅读
2评论
[POJ1936]All in All 试题描述 You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated st
转载
2016-08-25 16:06:00
117阅读
2评论
All in All题目链接:http://poj.org/problem?id=1936题目大意:判断从字符串s2中能否找到子串s1。字符串长度为10W。Sample Inputsequence subsequenceperson compressionVERDI vivaVittorioEmanueleReDiItaliacaseDoesMatter CaseDoesMatterSample OutputYesNoYesNo分析:这明明是模拟题,有人竟然把它归为动态规划,是要用LCS做吗代码如下: 1 # include 2 # include 3 # define MAX 100005
转载
2013-08-26 02:33:00
163阅读
2评论
Problem EAll in AllInput: standard inputOutput: standard outputTime Limit: 2 secondsMemory Limit: 32 MBYou have devised a new encryption technique which encodes a message by inserting betw
原创
2023-04-20 23:16:30
85阅读
水题坑点:边读边判断。#include<cstdio>#include<cstring>#define MAXN 1010char s[MAXN], t[MAXN];void solve(){ while((c = getchar()) != '\n'){ if(c == t[i])
原创
2022-10-21 16:07:37
40阅读
//UVa10340 - All in All//题目:判断s串是不是t串的子串。#include#includeint main(){ char s[20];int t, count=0; scanf("%s",s); getchar();//吸收换行符 while((t=getchar()) != '\n'){//1.边读取边比较,往前推进 if(t==s[count])
原创
2023-02-08 14:15:27
90阅读