多学习。

摘要: AcWing829.模拟队列 #include <iostream> using namespace std; const int N = 1e5+10; int q[N], hh, tt; int main() { int n, k; cin >> n; string c; while( n -- 阅读全文
posted @ 2022-05-11 19:23 czyaaa 阅读(40) 评论(0) 推荐(0)
摘要: AcWing828.模拟栈 #include <iostream> using namespace std; const int N = 1e5+10; int stk[N], tt; int main() { int n, k; cin >> n; string c; while(n -- ) { 阅读全文
posted @ 2022-05-11 19:22 czyaaa 阅读(39) 评论(0) 推荐(0)
摘要: 使用数组原因 因为new/malloc一个空间是非常慢,用数组模拟链表效率更高。 单链表:邻接表——AcWing826.单链表 题目 #include <iostream> #include <cstdio> using namespace std; const int N = 1e5+10; in 阅读全文
posted @ 2022-05-11 19:02 czyaaa 阅读(88) 评论(0) 推荐(0)