返回顶部
摘要: You want to perform the combo on your opponent in one popular fighting game. The combo is the string ss consisting of nn lowercase Latin letters. To p 阅读全文
posted @ 2020-02-28 18:54 _Kolibri 阅读(226) 评论(0) 推荐(0)
摘要: 题目: Returning back to problem solving, Gildong is now studying about palindromes. He learned that a palindrome is a string that is the same as its rev 阅读全文
posted @ 2020-02-20 01:11 _Kolibri 阅读(246) 评论(0) 推荐(0)
摘要: 给定一个大小为n≤106n≤106的数组。 有一个大小为k的滑动窗口,它从数组的最左边移动到最右边。 您只能在窗口中看到k个数字。 每次滑动窗口向右移动一个位置。 以下是一个例子: 该数组为[1 3 -1 -3 5 3 6 7],k为3。 窗口位置最小值最大值 [1 3 -1] -3 5 3 6 7 阅读全文
posted @ 2020-02-18 12:24 _Kolibri 阅读(257) 评论(0) 推荐(0)
摘要: 我们在理解stack和queue的基础上可以用数组来代替这两个容器,因为STL中的stack和queue有可能会导致程序运行起来非常的慢,爆TLE,所以我们使用数组来模拟他们,不仅可以更快,还可以让代码更加简洁 1.数组模拟stack #include <iostream> #include <cs 阅读全文
posted @ 2020-02-17 15:43 _Kolibri 阅读(387) 评论(0) 推荐(0)
摘要: 链表一般分为两种:1)单链表 2)双链表,二者是及其相似的,但双链表有两个指针 1.单链表: //数组模拟链表(快) #include <iostream> #include <cstdio> #include <cstring> #include <string.h> #include <math 阅读全文
posted @ 2020-02-17 15:31 _Kolibri 阅读(168) 评论(0) 推荐(0)
摘要: 题目:https://atcoder.jp/contests/abc155/tasks/abc155_c 这道题的题意是给我们n个string,让我们统计每个string出现的次数,并输出次数最多的一个或多个string(按字典序来排列) 当时我想的是用数组来统计每个string,之后再sort一次 阅读全文
posted @ 2020-02-17 00:16 _Kolibri 阅读(587) 评论(0) 推荐(0)
摘要: A.做游戏 https://ac.nowcoder.com/acm/contest/3003/A 签到题:只要求两个人当中最小的值就行了. #include <iostream> #include <cstring> #include <math.h> #include <algorithm> #i 阅读全文
posted @ 2020-02-07 18:20 _Kolibri 阅读(179) 评论(0) 推荐(0)
摘要: B.kotori和bangdream https://ac.nowcoder.com/acm/contest/3002/B 大水题 #include <iostream> #include <cstring> #include <math.h> #include <algorithm> #inclu 阅读全文
posted @ 2020-02-05 16:19 _Kolibri 阅读(159) 评论(0) 推荐(0)
摘要: 高精度的运算主要依靠动态数组vector和字符串实现对每一位数字的运算. 1.高精度加法 #include <iostream> #include <algorithm> #include <vector> using namespace std; vector<int> add(vector<in 阅读全文
posted @ 2020-01-21 12:35 _Kolibri 阅读(171) 评论(0) 推荐(0)
摘要: 一道递推题(我这个菜鸡刚开始以为是排列组合) 题目: 突破蝙蝠的包围,yifenfei来到一处悬崖面前,悬崖彼岸就是前进的方向,好在现在的yifenfei已经学过御剑术,可御剑轻松飞过悬崖。现在的问题是:悬崖中间飞着很多红,黄,蓝三种颜色的珠子,假设我们把悬崖看成一条长度为n的线段,线段上的每一单位 阅读全文
posted @ 2019-12-13 09:54 _Kolibri 阅读(144) 评论(0) 推荐(0)