上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页
摘要: 注意点: 为了保证复杂度,所以放弃去重,所以不可以用二分离散化 由于1的原因,所以find需要从后逐个往前找,因为同一个柜子可能多次放入,后面的是最新的记录 #include<iostream> #include<vector> using namespace std; #define PII pa 阅读全文
posted @ 2020-10-21 20:22 yys_c 阅读(155) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<stack> using namespace std; string s; stack<int> stk; int main(){ cin >> s; for(int i = 0; s[i] != '@'; i ++){ if(isdigit( 阅读全文
posted @ 2020-10-21 19:27 yys_c 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 用队列维护单词进入内存的时间顺序,并根据题目所给的内存限制动态调整内存区域存储的单词,并对内存中包括的单词做标记 注意:题面说如果内存中已经存在这个单词就不要到外存去找了,相应的不需要把这个单词放到内存里。 复杂度:\(O(n)\) #include<iostream> using namespac 阅读全文
posted @ 2020-10-21 19:14 yys_c 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 用队列维护的一个二十四小时的滑动窗口 #include<iostream> #include<cstring> using namespace std; const int N = 100010; struct Node{ int t, c; // 时间,国家 }; int n; int cnt[N 阅读全文
posted @ 2020-10-21 11:12 yys_c 阅读(58) 评论(0) 推荐(0) 编辑
摘要: s.lower_bound(x):二分出序列中最小的>=x的迭代器 s.upper_bound(x):二分出序列中最小的>x的迭代器 #include<iostream> #include<set> #include<cmath> using namespace std; const int N = 阅读全文
posted @ 2020-10-21 10:20 yys_c 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 都市之歌 街の歌 高い空 降る雪 > >高速(こうそく)ランプ 揺(ゆ)れる > >すれ违う(ちがう) 人は > >谁も速足(はやあし) > >赈(にぎ)やかな音(おと) 奏(かな)でる > >高いビル 见上げるの > >障害灯(しょうがいとう) > >赤く光る > >騒(さわ)めき 足音(あしおと 阅读全文
posted @ 2020-10-20 20:58 yys_c 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 栈 + 模拟 #include<iostream> #include<stack> #include<vector> #include<cstdio> using namespace std; stack<int> stk; int q; int main(){ cin >> q; while(q 阅读全文
posted @ 2020-10-20 20:15 yys_c 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 方法:循环链表 #include<iostream> using namespace std; const int N = 110; int h, e[N], ne[N], idx; int n, m; void init(){ h = -1; for(int i = n; i >= 1; i -- 阅读全文
posted @ 2020-10-20 19:35 yys_c 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 方法:双链表 #include<iostream> using namespace std; const int N = 100010; int e[N], l[N], r[N], idx; int value_node[N]; int n; void add(int x, int v){ valu 阅读全文
posted @ 2020-10-20 18:55 yys_c 阅读(89) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<stack> using namespace std; const int N = 110; stack<int> pos; char s[N]; int st[N]; int main(){ cin >> s + 1; for(int i = 阅读全文
posted @ 2020-10-19 22:05 yys_c 阅读(89) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页