摘要: 作业1 – 要求:在中国气象网(http://www.weather.com.cn)给定城市集的7日天气预报,并保存在数据库。 – 输出信息: Gitee文件夹链接 代码: from bs4 import BeautifulSoup from bs4 import UnicodeDammit imp 阅读全文
posted @ 2025-11-10 13:58 MENDAXZ 阅读(9) 评论(0) 推荐(0)
摘要: 1.作业①: 要求:用requests和BeautifulSoup库方法定向爬取给定网址(http://www.shanghairanking.cn/rankings/bcur/2020)的数据,屏幕打印爬取的大学排名信息。 输出信息: 1.1作业代码和图片 from bs4 import Beau 阅读全文
posted @ 2025-10-29 14:45 MENDAXZ 阅读(13) 评论(0) 推荐(0)
摘要: 1.概念 所有最大可行流中费用的最小/最大值 上图中的最小费用最大流就是15 每条边都有一个权值w,这条边如果流量是c,那么这条边的费用就是c*w 2.求法 把EK算法中的bfs函数换成spfa求源点到汇点的一条最短路即可 模板(普通) #include<bits/stdc++.h> #define 阅读全文
posted @ 2025-10-22 16:59 MENDAXZ 阅读(7) 评论(0) 推荐(0)
摘要: 定义 综合:最大流等于最小割 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 10010, M = 200010, INF = 1e8; int n, m, 阅读全文
posted @ 2025-10-13 12:34 MENDAXZ 阅读(6) 评论(0) 推荐(0)
摘要: bool isprime(int n) { if (n <= 1) { return false; } for (int i = 2; i * i <= n; i++) { if (n % i == 0) { return false; } } return true; } int findPrim 阅读全文
posted @ 2025-09-24 01:26 MENDAXZ 阅读(12) 评论(0) 推荐(0)
摘要: 1.最短路径转最大流 trick:无向图的话,就是建立反边,并且容量均为设定的f[i]即可 思路就是:二分答案x,然后对于权值大于x的容量都设为0,小于等于x的话f[i]设为1,源点是1,汇点是n,如果最大流的值>=K,那么x可以作为答案 代码: #include<bits/stdc++.h> #d 阅读全文
posted @ 2025-09-19 16:44 MENDAXZ 阅读(12) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; using point_t=long double; //全局数据类型,可修改为 long long 等 constexpr point_t eps=1e-8; constexpr long double P 阅读全文
posted @ 2025-09-15 11:30 MENDAXZ 阅读(20) 评论(0) 推荐(0)
摘要: 1.区间dp--精妙状态设计与转移 https://codeforces.com/contest/2129/problem/D dp[l][r][a][b]: 表示只考虑放置[l,r]区间内部的数,并且满足所有的s[l]~s[r]的条件,对l-1的贡献是a,对r+1的贡献是b的方案数 转移: 对于d 阅读全文
posted @ 2025-09-12 12:56 MENDAXZ 阅读(11) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define endl '\n' #define LL long long #define x first #define y second // #define int long long const LL 阅读全文
posted @ 2025-07-16 17:42 MENDAXZ 阅读(13) 评论(0) 推荐(0)
摘要: 返回的值可能会存在负数(即使传入参数a和b中的数全是正整数),若有需要可以给mul返回的结果取正 constexpr int P = 998244353; int power(int a, int b) { int res = 1; for (; b; b /= 2, a = 1LL * a * a 阅读全文
posted @ 2025-05-15 22:46 MENDAXZ 阅读(17) 评论(0) 推荐(0)