
字符串
cugzyc
Coding && Reading.
展开
-
字典序最大的子序列
链接:https://www.nowcoder.com/acm/contest/84/A来源:牛客网题目描述给定字符串s,s只包含小写字母,请求出字典序最大的子序列。 子序列:https://en.wikipedia.org/wiki/Subsequence 字典序:https://en.wikipedia.org/wiki/Lexicographical_order输入描述:一行一个字符串s (...原创 2018-05-04 15:39:18 · 1218 阅读 · 0 评论 -
G - 风格不统一如何写程序 HihoCoder - 1501
小Hi写程序时习惯用蛇形命名法(snake case)为变量起名字,即用下划线将单词连接起来,例如:file_name、 line_number。 小Ho写程序时习惯用驼峰命名法(camel case)为变量起名字,即第一个单词首字母小写,后面单词首字母大写,例如:fileName、lineNumber。 为了风格统一,他们决定邀请公正的第三方来编写一个转换程序,可以把一种命名法的变量名转换为...原创 2018-06-07 21:37:13 · 209 阅读 · 0 评论 -
字符串替换升级版(不用考虑两个字符串的长度)
#include<bits/stdc++.h>using namespace std;char s[100]="123123";char st[100]="456456456";char store[100];int main(){ char a[10005]; while(gets(a)!=NULL) { memset(store,0,sizeof(store)...原创 2018-06-12 20:32:09 · 348 阅读 · 0 评论 -
K - The Marshtomp has seen it all before HihoCoder - 1082
fjxmlhx不喜欢网上的 marshtomps 。所以他决定把所有的 “marshtomp”(名字不区分大小写) 改为 “fjxmlhx;Input输入包含多行,每行字符串不超过200的长度,一个单词不会一半出现在上一行,剩下的在下一行。直到文件结束(EOF)Output输出 替换之后的字符串。Sample InputThe Marshtomp has seen it all before.m...原创 2018-06-05 21:30:15 · 164 阅读 · 0 评论 -
字符串替换
you转化为we #include<bits/stdc++.h>using namespace std;int main(){ char a[1005]; while(gets(a)!=NULL) { int l=strlen(a); int i; for(i=0;i<l;i++) { if(a[i]=='y' && a[i+1]...原创 2018-06-12 18:53:01 · 231 阅读 · 0 评论 -
HDU-2087 剪花
#include<iostream>#include<string.h>using namespace std;char a[1005],b[1005];int main(){ int i; while(cin>>b && b[0]!='#') { cin>>a; int m=strlen(a); int...原创 2018-05-23 20:39:14 · 194 阅读 · 0 评论 -
NYOJ-5 Binary String Matching
Binary String Matching时间限制:3000 ms | 内存限制:65535 KB 难度:3描述 Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as a su...原创 2018-05-23 20:09:35 · 192 阅读 · 0 评论 -
HDU-2054 A == B ?
A == B ?Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 122472 Accepted Submission(s): 19573Problem DescriptionGive you two numbers A and B, ...原创 2018-05-16 21:08:54 · 147 阅读 · 0 评论 -
P3741 honoka的键盘
题目背景honoka 有一个只有两个键的键盘。题目描述一天,她打出了一个只有这两个字符的字符串。当这个字符串里含有"VK"这个字符串的时候,honoka 就特别喜欢这个字符串。所以,她想改变至多一个字符(或者不做任何改变)来最大化这个字符串内"VK"出现的次数。给出原来的字符串,请计算她最多能使这个字符串内出现多少次"VK"。(只有当"V"和"K"正好相邻时,我们认为出现了"VK"。)输入原创 2018-06-02 21:12:38 · 313 阅读 · 0 评论 -
牛客 月赛 C
链接:https://www.nowcoder.com/acm/contest/86/C来源:牛客网算卦先生来问你,对于每个他给出的 C++ 头文件,请告诉他是否存在。 头文件列表:algorithm, bitset, cctype, cerrno, clocale, cmath, complex, cstdio, cstdlib, cstring, ctime, deque, except...原创 2018-05-08 18:20:07 · 355 阅读 · 0 评论 -
H - 出勤记录I HihoCoder - 1481
小Hi的算法课老师每次上课都会统计小Hi的出勤记录。迟到会被记录一个L,缺席会被记录一个A,按时上课会被记录一个O。一学期结束,小Hi的出勤记录可以看成是一个只包含LAO的字符串,例如"OOOOLOOOLALLO……"。如果小Hi整学期缺席不超过1次,并且没有连续3次迟到,小Hi的出勤记录就算合格。 现在给出小Hi的出勤记录,你能判断他是否合格么?Input输入第一行包含一个整数T(1 <...原创 2018-06-10 21:53:53 · 710 阅读 · 0 评论