【习题 3-9 UVA - 10340】All in All】的更多相关文章

UVA 11636 Hello World 二的幂答案就是二进制长度减1,不是二的幂答案就是是二进制长度. #include<cstdio> int main() { ; ){ ; ) r++; printf("Case %d: %d\n",++kas,r); } ; } LA 3602 DNA Consensus String 贪心构造,每一位上选出现次数最多的. #include<bits/stdc++.h> using namespace std; ,ma…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 相当于让你判断s1是不是s2的子序列. for一遍就好 [代码] #include <bits/stdc++.h> using namespace std; string s1,s2; int main(){ #ifdef LOCAL_DEFINE freopen("F:\\c++source\\rush_in.txt", "r", stdin); #endif while (cin &…
题目 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1281 题意 问字符串a能否是字符串b的子序列 思路 明显,计数对的上就行 感想 因为忘了break错了一次 代码 #include <algorithm> #include <cassert> #include <cmath> #include &…
水题,从头到尾扫一遍就可以了,输入两个字符串s和t,判断是否可以从t中删除0个或多个字符(其他字符顺序不变),得到字符串s.例如,abcde可以得到bce,但无法得到dc. #include<algorithm> #include<cstring> #include<cstdio> #include<iostream> #define len 101000 using namespace std; char s[len], t[len]; int main(…
Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memory Limit: 32 MB You have devised a new encryption technique whichencodes a message by inserting between its characters randomly generatedstrings in a clever…
https://vjudge.net/problem/UVA-10340 题意: 输入两个字符串s和t,判断是否可以从t中删除0个或多个字符得到字符串s. 思路: 很水的题... #include<iostream> #include<string> #include<cstring> using namespace std; string s, t; int main() { //freopen("D:\\txt.txt", "r&quo…
题意:给定两个字符串,问第一个串能不能从第二个串通过删除0个或多个字符得到. 析:那就一个字符一个字符的匹配,如果匹配上了就往后走,判断最后是不是等于长度即可. 代码如下: #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> using namespace std; string s1, s2; int mai…
#include <stdio.h> #include <algorithm> #include <cstring> using namespace std; ],t[]; int cmp(char *s1,char *s2) { int i,j,l1,l2; l1=strlen(s1),l2=strlen(s2); ,j=;i<l1,j<l2; ) //s1是子串(赋值语句有条件,故在for内省略 { if(s1[i]==s2[j]) i++,j++; e…
看题传送门 Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memory Limit: 32 MB You have devised a new encryption technique whichencodes a message by inserting between its characters randomly generatedstrings in a c…
 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 in detail how the strings are generated and inse…