OVSolitario-io

导航

2025年12月31日 #

C++面向对象

摘要: 0x01基础概念 1.引用 点击查看代码 void iswap(int& a, int& b) {//除C中& + *指针的形式外C++引用 int t = a; a = b, b = t; } int x = 4; int& iValue() {return x;} int main() { // 阅读全文

posted @ 2025-12-31 15:44 TBeauty 阅读(0) 评论(0) 推荐(0)

2025年12月17日 #

Dp(整理篇)

该文被密码保护。 阅读全文

posted @ 2025-12-17 16:11 TBeauty 阅读(0) 评论(0) 推荐(0)

2025年12月5日 #

还没想好题目

该文被密码保护。 阅读全文

posted @ 2025-12-05 20:36 TBeauty 阅读(0) 评论(0) 推荐(0)

2025年12月3日 #

链表

摘要: 约瑟夫问题(链表) #include <bits/stdc++.h> using namespace std; int nxt[110], n, m; int main() { scanf("%d%d", &n, &m); for(int i = 1; i < n; ++ i) nxt[i] = i 阅读全文

posted @ 2025-12-03 16:11 TBeauty 阅读(4) 评论(0) 推荐(0)

2025年12月1日 #

DP题单-衔接版

摘要: P6567 [NOI Online #3 入门组] 买表 阅读全文

posted @ 2025-12-01 20:20 TBeauty 阅读(3) 评论(0) 推荐(0)

2025年11月27日 #

树&图习题1

摘要: P1807最长路:最长路 由\(w \in [-1e5, 1e5]\),n = 1500可知 (答案 >= 1.5e8) 以此来作为1~n通路的判定,维护f[]数组即可 阅读全文

posted @ 2025-11-27 09:45 TBeauty 阅读(2) 评论(0) 推荐(0)

2025年11月25日 #

集训-开营前的沉思

该文被密码保护。 阅读全文

posted @ 2025-11-25 09:10 TBeauty 阅读(0) 评论(0) 推荐(0)

2025年11月24日 #

动态问题 <-> 静态问题(互相转化,类似扫描线)

摘要: 将静态的问题变为动态的待修改的问题 逆序对2:问有多少组(i,j)有i < j并且a[i] > a[j] (每个a[i]只出现一次) 思想1:对于i<j,a[i] > a[j]静态问题,将其转化为动态待修改问题 类似: for j = 1 ~ n 统计a1~j-1里>a的数的个数 维护一个数据结构D 阅读全文

posted @ 2025-11-24 18:43 TBeauty 阅读(6) 评论(0) 推荐(0)

树状数组(不能有0,否则加lowbit一直为0死循环)

摘要: lowbit:lowbit(x) = x & -x 我们知道反码 = 全1 - x(当前数) + 1 => 补码,即 (反码 + 1)(补码) - x 111111 - x + 1 <=> 1000000 - x e.g.此时有前面x & -x有前面消去 树状数组 维护序列a1,a2··an,有O( 阅读全文

posted @ 2025-11-24 07:38 TBeauty 阅读(8) 评论(0) 推荐(0)

2025年11月22日 #

最小生成树(整理篇)

摘要: prim #include <bits/stdc++.h> using namespace std; const int N = 400500, INF = 2147483647; typedef pair<int, int> PII; bool st[N]; int n, m, dist[N], 阅读全文

posted @ 2025-11-22 22:40 TBeauty 阅读(9) 评论(0) 推荐(0)