文章分类 -  OI题目

上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要:>>>快速幂(res,a,b)阶乘的最快 唯一考点 :::数组初次使用 初始化为 0 #include<cstdio> #include<cmath> #include<cstring> using namespace std; int f[1001],p,res[1001];//乘法要开两倍长度 阅读全文
posted @ 2023-08-09 20:52 JMXZ
摘要:>>> ##先想一下算法:因为题目里出现了“最优解”,“最好的方案”关键字,所以一定会用贪心。然后从题目给的样例解释可以看到:如果相邻的两行有许多组说话的同学,那么在这两行中间加一条过道是非常划算的;同理,列也是如此。 ##恍然大悟,只要找出划分哪些相邻的两行和相邻的两列可以隔开的同学最多,此题可解 阅读全文
posted @ 2023-08-09 20:13 JMXZ
摘要:>>> 去看 极值 度数 rd==0 cd==0 连起来就是环 -> max(rd==0 sum, cd==0 sum) >>> 每一对点 只能算出 缩点 rd cd ==0 的情况, #include<cstdio> #include<bits/stdc++.h> using namespace 阅读全文
posted @ 2023-08-07 21:51 JMXZ
摘要:>>> de[]->big lian >>>co[] -> point belong >>>只能统计 极值 cd rd ==0 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bit 阅读全文
posted @ 2023-08-07 17:19 JMXZ
摘要:>>>在有向图G中,如果两个顶点间至少存在一条路径,称两个顶点强连通。如果有向图G的每两个顶点都强连通,称G是一个强连通图。有向图非强连通图的极大强连通子图,称为强连通分量。 说白了就是如果一个有向图的子图里每个点可以两两互达,那么这个子图是一个强联通分量 -> 两两可以到达 Tarjan算法就是基 阅读全文
posted @ 2023-08-07 16:56 JMXZ
摘要:>>>x+z/2 -> x z same 奇偶 >>>∑ i*(s[c[i]][i%2]*x[i]+ sum[ c[i] ][i%2] ) #include <cmath> #include <ctime> #include <cstdio> #include <string> #include < 阅读全文
posted @ 2023-08-07 13:13 JMXZ
摘要::::差分 不要太认真 模拟一下就可以 #include<bits/stdc++.h> using namespace std; int diff[10000005],n,m; int main() { scanf("%d%d",&n,&m); for(int i = 1; i <= n; i++) 阅读全文
posted @ 2023-08-07 01:51 JMXZ
摘要:>>> large ans -> long long or-> exceed >>> x<=mid or -> smalller :::每一次 + * 操作都是 合法合规的 s[].l>=x&&s[].r<=y 对node 操作 else pushdown 因为有 误差 /* 5 5 38 1 5 阅读全文
posted @ 2023-08-07 01:21 JMXZ
摘要::::素都会根据元素的键值自动排序 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd p 阅读全文
posted @ 2023-08-05 11:08 JMXZ
摘要:>>>圆 不相交 》》》 可能在同一个 圆形 ——整形运算 快于 double —— 强制转换 ans=(double) int/int -> double or int 因为double也可以有整数 #include<cstdio> #include<cstring> #include<iostr 阅读全文
posted @ 2023-08-04 17:20 JMXZ
摘要:#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd printf(" debug\n"); 阅读全文
posted @ 2023-08-04 14:14 JMXZ
摘要:》》》 RMQ -》 dp 》》》dp 泛着定义 f[i][j] -> i-1<<j+1 -> 每一部分 1<<j /*5 100 A 96 Q 1 A 97 Q 1 Q 2 96 93 96 */ #include<cstdio> #include<cstring> #include<iostre 阅读全文
posted @ 2023-08-04 00:03 JMXZ
摘要:>>>dfs 繁琐 //cin scanf 不混用 // && check tioajian #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #defi 阅读全文
posted @ 2023-08-03 14:45 JMXZ
摘要:>>> 数字输入 也可以当作string 取决于你 用什么定义 》》》 char -'0' -> int #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> 阅读全文
posted @ 2023-08-03 00:18 JMXZ
摘要:/* 89 126 85 103 101 86 86 98 96 99 89 81 101 92 79 77 82 97 83 100 78 72 79 97 71 80 98 89 69 74 */ //12 6 [12,8] #include <bits/stdc++.h> #include<i 阅读全文
posted @ 2023-08-01 18:52 JMXZ
摘要:明显的 dfs >>>string cnt be >> s+1 >>>dfs string better 想好再打 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc 阅读全文
posted @ 2023-08-01 16:18 JMXZ
摘要:>>>string -> cin >>> char-> scanf #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long lo 阅读全文
posted @ 2023-07-31 12:17 JMXZ
摘要:》》》canf() 遇到\n 会停止 但\n 任然存在 》》》cin \n 会停止 但\n 不处理 没有 ios::sync_with_stdio(false); >>>如字符串 this 中可包含 this 和 is,选用 this 之后就不能包含 th。 直接计数 -》 违反 所以 back-> 阅读全文
posted @ 2023-07-31 08:06 JMXZ
摘要:>>>int 可以 -> long long >>>you mod no long long arrary ky have ll sum>>>wu mod long long //int 可以 -> long long //you mod no long long arrary ky have ll 阅读全文
posted @ 2023-07-29 21:15 JMXZ
摘要:>>>vis[][] -> 减少访问 》》》dfs 要检查返回 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long 阅读全文
posted @ 2023-07-29 10:49 JMXZ

上一页 1 ··· 5 6 7 8 9 10 11 12 下一页