![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题
_WuZHua
初入软件,自学算法,多多指教!
展开
-
日常算法刷题整理
日常算法刷题整理一、字符串处理二、数学三、数据结构1、区间问题1.1、树状数组板子:#include<iostream>#include<vector>#define type intusing namespace std;// n:元素个数,m:操作次数int n, m;vector<type> a, c; // a是原数组,c是树状数组int lowbit(int x){ return x&(-x);}void原创 2020-11-16 10:36:51 · 190 阅读 · 0 评论 -
One-Dimensional Battle Ships
One-Dimensional Battle ShipsAlice and Bob love playing one-dimensional battle ships. They play on the field in the form of a line consisting of n square cells (that is, on a 1 × n table).At the beginning of the game Alice puts k ships on the field withou原创 2020-08-13 22:52:07 · 163 阅读 · 0 评论 -
1052 Linked List Sorting (25分)
1052 Linked List Sorting (25分)A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure. Now given a linked list, you are原创 2020-06-30 23:17:13 · 117 阅读 · 0 评论 -
1045 Favorite Color Stripe (30分)
Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts...原创 2020-04-04 22:39:21 · 110 阅读 · 0 评论 -
L3-003 社交集群 (30分)
我的思路其实很简单 这题是比较标准的 并查集 类型的题目。 主要思想就是一个常规的并查集数组 f[MAXN] 保存各个成员之间的朋友关系 那么不同兴趣圈的人怎么建立朋友关系呢? 我的办法是通过另一个变量存储不同的兴趣圈里的人是哪些,然后在读取数据的时候,一个人若是发现有兴趣A,则遍历一遍兴趣A所在的兴趣圈, 与...原创 2020-02-08 15:39:53 · 777 阅读 · 0 评论