水题
Mongo_w
本人很菜
新个人主页https://training.517coding.com/%E7%94%A8%E6%88%B7:Laijunxu
我的luogu:https://www.luogu.com.cn/user/78127
展开
-
2020-12-12
#include<iostream> #include<cstdio> #include<algorithm> #define ll long long using namespace std; const int N = 1000010 , M = 2000010; int h[N] , to[M] , nxt[M] , tot; int n , in[N] , out[N] , idx , len; ll num[N] , c[N] , ans; inline原创 2020-12-12 17:06:55 · 60 阅读 · 0 评论 -
贼水贼恶心
Acwing 172 #include<iostream> #include<cstdio> #include<cstring> using namespace std; struct nod{ int x , y , z;//lie: 0竖着 1横卧 2竖卧 } q[1000010]; int l , r , pre[1000010]; bool fl...原创 2020-02-28 18:13:36 · 80 阅读 · 0 评论 -
水题
只要是举例map和set的用法 二者的区别: map支持下标引用,set不支持 set和multiset的区别: set没有重复数据,multiset支持重复数据 题目链接: hdu 2648 Code: #include<cstdio> #include<iostream> #include<string> #include<map> us...原创 2020-02-12 09:29:16 · 113 阅读 · 0 评论 -
哈希学习笔记
先上一道模板题: 维护一个集合,支持如下几种操作: 1.“I x”,插入一个数x; 2. “Q x”,询问数x是否在集合中出现过; 现在要进行N次操作,对于每个询问操作输出对应的结果。 输入格式 第一行包含整数N,表示操作数量。 接下来N行,每行包含一个操作指令,操作指令为”I x”,”Q x”中的一种。 输出格式 对于每个询问指令“Q x”,输出一个询问结果,如果x在集合中出现过,则输出“Ye...原创 2019-12-23 17:32:07 · 126 阅读 · 0 评论 -
链表水题
先贴题目: 17.从头到尾打印链表 28.用O(1)的时间删除结点 29.删除链表中重复的结点 33. 链表中倒数第k个节点 34. 链表中环的入口结点 35. 反转链表 36. 合并两个排序的链表 以下是核心 vector<int> ans; ListNode *p=head; while(p!=NULL){ an...原创 2019-12-20 19:03:21 · 109 阅读 · 0 评论 -
Blah数集 题解
题目:Blah数集 #include<iostream> #include<cstdio> #include<queue> using namespace std; const int p=1000001; int H[1000001]; int Find(int x){ int k=x%p; while(H[k]&&H[k]!=x) k++...原创 2019-11-27 17:13:19 · 770 阅读 · 0 评论