
刷题
_WuZHua
初入软件,自学算法,多多指教!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
日常算法刷题整理
日常算法刷题整理 一、字符串处理 二、数学 三、数据结构 1、区间问题 1.1、树状数组 板子: #include<iostream> #include<vector> #define type int using 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 · 237 阅读 · 0 评论 -
One-Dimensional Battle Ships
One-Dimensional Battle Ships Alice 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 · 210 阅读 · 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 · 261 阅读 · 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 · 153 阅读 · 0 评论 -
L3-003 社交集群 (30分)
我的思路其实很简单 这题是比较标准的 并查集 类型的题目。 主要思想就是一个常规的并查集数组 f[MAXN] 保存各个成员之间的朋友关系 那么不同兴趣圈的人怎么建立朋友关系呢? 我的办法是通过另一个变量存储不同的兴趣圈里的人是哪些,然后在读取数据的时候,一个人若是发现有兴趣A,则遍历一遍兴趣A所在的兴趣圈, 与...原创 2020-02-08 15:39:53 · 875 阅读 · 0 评论