摘要: ![image-20231015110034212](http://cdn.selfharbor.top//blog/202310151100241.png) 阅读全文
posted @ 2023-10-15 11:01 30天CF上蓝!!! 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<sstream> using namespace std; const int N=1e7+10;//有点nb ,8位回文数一定是11 阅读全文
posted @ 2021-02-18 15:57 30天CF上蓝!!! 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #define PI 3.141592653589793238462 #define eps 1e-10 using namespace std; typedef long long ll; typedef long double db; typede 阅读全文
posted @ 2021-02-06 22:08 30天CF上蓝!!! 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 离散化(不去重) 2 33423434 437834 25345 373 35 //将上面的数字换成下边的 1 6 5 4 3 2 之后再通过楼兰图腾中的思想求逆序对 #include<iostream> #include<algorithm> #include<cstring> #include< 阅读全文
posted @ 2021-02-03 23:27 30天CF上蓝!!! 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 多重背包II中的二进制拆分 for(int i=1;i<=n;i++) { int a,b,s;cin>>a>>b>>s;//体积、价值、数量 int k=1; while(k<=s) { w[++cnt]=a*k,v[cnt]=b*k; s-=k; k*=2; } // cout<<"s=="<< 阅读全文
posted @ 2021-01-15 11:45 30天CF上蓝!!! 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2021-01-14 15:40 30天CF上蓝!!! 阅读(32) 评论(0) 推荐(0) 编辑
摘要: ###A #include<iostream> #include<algorithm> using namespace std; typedef pair<int,int>PII; const int N=5100; int main() { int t;cin>>t; while(t--) { i 阅读全文
posted @ 2021-01-13 16:00 30天CF上蓝!!! 阅读(75) 评论(0) 推荐(0) 编辑
摘要: ##0.A - Simple Math 2 $ 让我非常自闭的一道题,当时题还读反了,要求输出\lfloor \frac{10N} \rfloor%M\ 1<=N<=10{18}\ 1<=M<=104\ 已知\lfloor \frac{\lfloor \frac \rfloor } \rfloor 阅读全文
posted @ 2021-01-10 10:39 30天CF上蓝!!! 阅读(138) 评论(0) 推荐(0) 编辑
摘要: $ O(n*m)spfa求负环时间复杂度较高\ 负环:图中存在一个环,环上个边的权值和为负数\ 01分数规划\ 求负环的方法,基于SPFA:\ (1)统计某个点入队的次数,如果某个点入队n次,则说明存在负环\ (2)统计当前每个点的最短路所含的边数,如果某点的最短路的边数>=n,则存在负环。\ 图中 阅读全文
posted @ 2020-12-09 14:53 30天CF上蓝!!! 阅读(71) 评论(0) 推荐(0) 编辑
摘要: HNOI2012矿场搭建 ###题意 $ 给定一个无向图,可能不连通,如果图中某个点坍塌,要求其他点一定能从某个出口逃出,\ 问:至少设计几个出口和不同的最小救援出口的设置数量。 $ ###解析 $ 设最小出口数为ans,方案数为num\ 分别分析每一个连通块,分析每一个连通块中的v-dcc\ 1. 阅读全文
posted @ 2020-12-09 13:33 30天CF上蓝!!! 阅读(133) 评论(0) 推荐(0) 编辑