- 博客(15)
- 资源 (4)
- 收藏
- 关注
原创 【CF 1096B】Substring Removal
B. Substring RemovalYou are given a string ss of length nn consisting only of lowercase Latin letters.A substring of a string is a contiguous subsequence of that str...
2018-12-31 00:32:58 303
原创 【CF 1087A】Right-Left Cipher
A. Right-Left CipherPolycarp loves ciphers. He has invented his own cipher called Right-Left.Right-Left cipher is used for strings. To encrypt the string s=s1s2…sns...
2018-12-26 23:53:47 423
原创 【HDU 1161】Eddy's mistakes
原题地址:http://acm.hdu.edu.cn/showproblem.php?pid=1161简单字符串处理,使用gets()函数或getlin()函数读取串加以判断即可代码:#include<iostream>#include<algorithm>#include<cstring>#include<string>#in...
2018-12-25 22:48:01 169
原创 【CF 1092B】Teams Forming
B. Teams FormingThere are nn students in a university. The number of students is even. The ii-th student has programming skill equal to aiai.The coach wants to form...
2018-12-24 23:29:49 333
原创 【HDU 2018】母牛的故事
原题地址:http://acm.hdu.edu.cn/showproblem.php?pid=2018 通过推算可以得知牛的数目增长规律是斐波那契数列,且 f[n]=f[n-1]+f[n-3];用递归写就是:#include<iostream>#include<algorithm>#include<cstring>#include<...
2018-12-21 23:24:32 180
原创 【CF 1092A】Uniform String
A. Uniform StringYou are given two integers nn and kk.Your task is to construct such a string ss of length nn that for each ii from 11 to kk there is at least ...
2018-12-19 23:31:47 517
原创 【HDU 1061】Rightmost Digit 快速幂
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1061 题意:t组样例,输入n,输出n^n的个位是多少。代码:#include<iostream>#include<algorithm>#include<cstring>#include<string>#include<cs...
2018-12-17 23:00:41 173
原创 【CF 1084A】The Fair Nut and Elevator
A. The Fair Nut and ElevatorThe Fair Nut lives in nn story house. aiai people live on the ii-th floor of the house. Every person uses elevator twice a day: to get from...
2018-12-12 23:15:22 360
原创 【CF 1090M】The Pleasant Walk
M. The Pleasant WalkThere are nn houses along the road where Anya lives, each one is painted in one of kk possible colors.Anya likes walking along this road, but s...
2018-12-10 20:58:11 473
原创 【CF 1090A】Company Merging
A. Company MergingA conglomerate consists of nn companies. To make managing easier, their owners have decided to merge all companies into one. By law, it is only pos...
2018-12-10 20:54:41 493
原创 【CF1088B】Ehab and subtraction
B. Ehab and subtractionYou're given an array aa. You should repeat the following operation kk times: find the minimum non-zero element in the array, print it, and the...
2018-12-09 20:24:43 423
转载 有10瓶药,每瓶有10粒药,其中有一瓶是变质的。好药每颗重1克,变质的药每颗比好药重0.1克。问怎样用天秤称一次找出变质的那瓶药。
有10瓶药,每瓶有10粒药,其中有一瓶是变质的。好药每颗重1克,变质的药每颗比好药重0.1克。问怎样用天秤称一次找出变质的那瓶药。 先将这十瓶药由一到十按顺序排好,或在瓶上贴上数字,然后在一号瓶上拿出一粒药,二号拿两粒,如此类推,十号拿十粒。总共是五十五颗药。再将这些药一次称。多出的量,那个数字就代表哪个瓶,而那瓶药就是变质的药。比如称出的重量是五十五点二,那么第二瓶药就是变质的!...
2018-12-02 17:24:32 5319 1
原创 【HDU 1020】Encoding
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1020 题意:将字符串中子串的重复部分缩写例如:ABBCCC输出:A2B3C 代码:#include<iostream>#include<algorithm>#include<cstring>#include<string&g...
2018-12-02 17:20:16 215
转载 HDU题型分类
基础题:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、 1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、1090、1091、1092、1093、 1094、1095、1096、1097、1098、1106、1108、1157、1163、1164、1170、11...
2018-12-02 16:54:52 820 1
原创 【牛客】小乐乐匹配字符串
题目地址:https://ac.nowcoder.com/acm/contest/301/E题目描述小乐乐有字符串str1,str2。小乐乐想要给他们找朋友。小乐乐想知道在这两个字符串中最多能匹配出多长的相同子串(可非连续)。输入描述:第一行输入字符串str1;第二行输入字符串str2;数据保证字符串长度小于1000,且非空,字符串仅由小写字母组成。输出描述:...
2018-12-02 15:56:56 264
车站票务系统.cpp
2019-11-20
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人