跳到正文

剪贴板

剪贴板 xi7j3bzd

原文
剪贴板信息

剪贴板信息

收录
更新

《洛谷自动AC程序》

和我一起击剑??点击加入

进来撸猫

友链

  • 2021.12.26: 100+ (卧槽怎么突然100+访问了)
  • 2022.1.3: 200+
  • 2022.1.18: 300+
  • 2022.1.20: 400+
  • 2022.1.22: 500+
  • 2022.1.30: 600+
  • 2022.2.5: 1000+
  • 2022.2.12: 1200+
  • 2022.4.10: 1600+
  • 不知道什么时候: 1800+
  • 不知道什么时候: 1900+
  • 不知道什么时候: 2000+
  • 不知道什么时候: 2100+
  • 2022.7.4: 2200+
  • 不知道什么时候: 2300+
  • 2022.7.17: 2400+
  • 不知道什么时候: 3100+

鄙人Github

Anurag's GitHub stats

生涯

我的练习情况

吉利的用时\color{black}吉利的用时

序号名称稳定性最好时间复杂度最坏时间复杂度平均时间复杂度
1.插入排序√O(n)O(n)O(n2)O(n^2)O(n2)O(n^2)
2.选择排序×O(n2)O(n^2)O(n2)O(n^2)O(n2)O(n^2)
3.冒泡排序√O(n)O(n)O(n2)O(n^2)O(n2)O(n^2)
4.堆排序×O(nlog⁡n)O(n \log n)O(nlog⁡n)O(n \log n)O(nlog⁡n)O(n \log n)
5.快速排序×O(nlog⁡n)O(n \log n)O(n2)O(n^2)O(nlog⁡n)O(n \log n)
6.归并排序√O(nlog⁡n)O(n \log n)O(nlog⁡n)O(n \log n)O(nlog⁡n)O(n \log n)
7.希尔排序×滚滚滚
8.桶排序无O(n+m)O(n + m)O(n+m)O(n + m)O(n+m)O(n + m)

宝藏

打字练习网站

吊图生成器

代码模板

妈妈再也不用担心我找不到系统镜像了

妈妈我再也不用忍受巨硬(微软)的下载速度了

好东西

最好的在线编辑器——replit

图标

linux装13必备

一个很猛的字体

linux game

neovide

github镜像站

我大车万永世长存!!!

代码
"AC=Answer Coarse=粗劣的答案"

"WA=Wonderful Answer=好答案"

"TLE=Time Limit Enough=时间充裕"

"MLE=Memory Limit Enough=内存充裕"

"CE=Compile Easily=轻松通过编译"

"RE=Run Excellently=完美运行"

"UKE=Unbelievablly Keep Enough Score=难以置信地保持足够的分数"

"AU=All Unaccepted=全都不正确"

给喜欢到处跑跑的人的vim极简配置:

代码
set st=2
set ts=2
set sts=2
set sw=2
set ss=1
set autoindent
set cindent
set cino+=g0
set autoindent
set smartindent
set expandtab
set nu
set nowrap " vim的折行太反人类了
set guifont=Lucida_Console:h14
set t_Co=256
syntax enable
set background=dark
color solarized
" 去掉那些乱七八糟没有用的gui
set guioptions-=m
set guioptions-=T
set guioptions-=t
set guioptions-=r
set guioptions-=r
set guioptions-=L
set guioptions-=R
set guioptions-=e

map <F5> :bot term ++rows=10 cmd /c (g++ % -o %< && echo build && %<) <CR>

重工业的艺术

众所周知,cpp的max没有泛型

C++
template <class type_, class cmp_> struct Max {
  cmp_ cmper;
  type_ operator()(const type_& a, const type_& b) {
    return cmper(a, b) ? a : b;
  }
};

重工业版ST表

C++
template <class cmp>
class ST {
private:
  int LOG[MAXN];
  int (*a)[MAXN];
  cmp cmper;

public:
  void build(int a[][MAXN], int n) {
    this->a = a;
    LOG[1] = 0;
    LOG[2] = 1;
    for (int i = 3; i < MAXN; i++) {
      LOG[i] = LOG[i / 2] + 1;
    }
    for (int j = 1; j < MAXLOG - 1; j++) {
      for (int i = 1; i <= n; i++) {
        if (i + (1 << j) - 1 <= n) {
          a[j][i] = cmper(a[j - 1][i], a[j - 1][i + (1 << (j - 1))]);
        }
      }
    }
  }

  int get(int l, int r) {
    int k = LOG[(r - l + 1)];
    return cmper(a[k][l], a[k][r - (1 << k) + 1]);
  }

  ST() { }
  ST(int a[][MAXN], int n) {
    build(a, n);
  }
};

比起标准的类更像make_heap一样只是一个工具集,用来方便维护ST表 当然,我做过要用ST表维护过很奇怪东西的题目,不只是一个greater或者less这么简单 所以泛型参数需要一个用来处理数据合并的类

C++
ST<Max<int, greater<int>>> high;
ST<Max<int, less<int>>> low;
high.build(a[0], n);
low.build(a[1], n);

重工业版splay

开发ing

重工业版分块

开发ing

Github 的 hosts

代码
140.82.112.26                 alive.github.com
140.82.114.25                 live.github.com
185.199.108.154               github.githubassets.com
140.82.113.21                 central.github.com
185.199.108.133               desktop.githubusercontent.com
185.199.108.153               assets-cdn.github.com
185.199.108.133               camo.githubusercontent.com
185.199.108.133               github.map.fastly.net
199.232.69.194                github.global.ssl.fastly.net
140.82.114.3                  gist.github.com
185.199.108.153               github.io
140.82.114.3                  github.com
192.0.66.2                    github.blog
140.82.113.6                  api.github.com
185.199.108.133               raw.githubusercontent.com
185.199.108.133               user-images.githubusercontent.com
199.232.68.133                favicons.githubusercontent.com
185.199.108.133               avatars5.githubusercontent.com
185.199.108.133               avatars4.githubusercontent.com
185.199.108.133               avatars3.githubusercontent.com
185.199.108.133               avatars2.githubusercontent.com
185.199.108.133               avatars1.githubusercontent.com
185.199.108.133               avatars0.githubusercontent.com
199.232.68.133                avatars.githubusercontent.com
140.82.112.9                  codeload.github.com
54.231.135.185                github-cloud.s3.amazonaws.com
52.216.224.128                github-com.s3.amazonaws.com
52.217.92.180                 github-production-release-asset-2e65be.s3.amazonaws.com
52.216.112.235                github-production-user-asset-6210df.s3.amazonaws.com
52.217.139.241                github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153               githubstatus.com
64.71.144.202                 github.community
23.100.27.125                 github.dev
199.232.68.133                media.githubusercontent.com
185.199.108.133               cloud.githubusercontent.com
185.199.108.133               objects.githubusercontent.com

比较简洁的splay写法

C++
  void connect(node* father, node* son, int d) {
  if (father != null) father->son[d] = son;
  if (son != null) son->father = father;
}

void rotate(node* p) {
  if (p == null) return;
  node* father = p->father;
  node* grand  = father->father;
  int   w1 = get(p), w2 = get(father);
  connect(father, p->son[w1 ^ 1], w1);
  connect(p, father, w1 ^ 1);
  connect(grand, p, w2);
  pushup(father);
  pushup(p);
  pushup(grand);
}

void splay(node* p, node* top) {
  if (p == null) return;
  for (node* father = p->father; (father = p->father) != top; rotate(p)) {
    if (father->father != top) {
      rotate(get(father) == get(p) ? father : p);
    }
  }
  if (top == null) root = p;
}