ICode9

精准搜索请尝试: 精确搜索
  • P1967 [NOIP2013 提高组] 货车运输2022-08-31 13:02:07

    给定一张图, \(q\) 组询问从 \(s_i\) 到 \(t_i\) 路径上最大边权的最小值。 \(n < 10^4\),\(m < 5 \times 10^4\),\(q<3\times10^4\)。 首先,所有询问的答案均在原图的最小生成树上,是最小生成树的瓶颈边,因为任何不在最小生成树上的边一定比原边更大,然后问题就变成寻找树上2点的路径上

  • 331 树分治 点分治2022-08-23 14:32:19

    视频链接: Luogu P3806 【模板】点分治1 #include<iostream> #include<algorithm> using namespace std; const int N=10005; const int INF=10000005; struct node{int v,w,ne;}e[N<<1]; int idx,h[N]; //加边 int del[N],siz[N],mxs,sum,root;//求根 int dis[N],d[N],c

  • 快速排序2022-05-29 16:00:23

    快排 #include<iostream> #include<algorithm> using namespace std; int n,num[10005],m; void qsort(int l,int r) { int i=l,j=r,flag=num[(i+r)/2]; while(i<=j) { while(num[i]<flag)i++; while(num[j]>flag)j--; if(i<=j) { swap(n

  • 最小不相交路径覆盖2022-03-03 01:04:20

    例1 hdoj 1151 air raid 有一张有向图,一些伞兵可以落在任意位置,沿着有向边往前走。注意一条路仅能被一个伞兵经过 问最少派出多少个伞兵 题解 这是一个最小(不相交)路径覆盖问题,因为从每个点出发,下一步最多经过一条边,因此可以用二分匹配解决(可以想见) code #include<bits/stdc++.h>

  • 2I寒冰王座2022-02-05 17:59:05

    #include<bits/stdc++.h> using namespace std; int dp[10005]; int maxhh(int x,int y) {     if(x>=y)return x;     else return y; } int main()  {         int N,C,i,j,p[4]={0,150,200,350};//录入商品数据      scanf("%d",&C);     while(C--)  

  • 1624C - Division by Two and Permutation(1100)2022-01-14 23:31:38

    #include<bits/stdc++.h> using namespace std; int vis[10005],a[10005],t,n; int main(){ scanf("%d",&t); while(t--){ bool flag = true; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf(&

  • poj 1064(注意二分搜索变形中l,r,mid的取值和结果取mid还是l 抑或r )2021-11-21 15:01:45

    #include<iostream> #include<cmath> using namespace std; int n,k; int data[10005]; bool check(int len){ int sum = 0; for(int i=0;i<n;i++){ sum += data[i]/len; if(sum>=k)return true; } return false; } int m

  • 微信登录失败 此公众号并没有这些scope的权限,错误码:100052021-11-10 15:32:18

    该错误是因为公众号没有获得【网页授权】权限,如下图:         点击修改, 进入功能设置页面,如下图:    首先设置网页授权域名,点击设置,如下图:    按照提示下载MP文件。 1. 将MP文件上传到服务器,放在服务器根目录下, 我的项目是用nginx部署的,看了nginx的配置文件后,看到MP文件

  • 【牛客SQL】SQL44 将id=5以及emp_no=10001的行数据替换成id=5以及2021-10-29 10:30:21

    题目描述 将id=5以及emp_no=10001的行数据替换成id=5以及emp_no=10005,其他数据保持不变,使用replace实现,直接使用update会报错。 题解 运行时间:52ms 超过18.78% 用Mysql提交的代码 占用内存:7532KB 超过2.50%用Mysql提交的代码 REPLACE INTO titles_test VALUES (5, 10005, '

  • CF148E Porcelain2021-10-12 16:04:05

    LIsa 就是一个背包 #include<cstdio> #include<iostream> #include<cstring> #include<iomanip> #include<cmath> #include<algorithm> #define int long long using namespace std; template<class T>inline void read(T &x) {

  • 2021 10 05 模拟赛2021-10-06 10:01:30

    文章目录 1.寻找道路2.国王的游戏3.我吃了,没有4.海底珍珠串题面(洛谷上无所以贴出) 1.寻找道路 洛谷P2296 还是贴个原题吧 原题 思路:搜索,图 其他的可能:宽搜? 我的代码 #include<bits/stdc++.h> using namespace std; struct node{ int to,next; }edge[200005]; node edge

  • DP专辑-codeforces1579-G. Minimal Coverage2021-10-02 20:00:35

    这个题的转移状态不好想: 设f[i][j]为:在第i个数,当前位置与开头位置距离为j时,end位置的最小值 我们不需要确定最左端位置在哪里,只要知道相对位置就好了,可以想做将他们平移到零点 每次更新我们只要枚举和开始节点的长度 j 进行更新,注意到一点特征,ai<=1000,那么距离 j 肯定是 j<=2000

  • P1280 尼克的任务(DP)2021-09-28 23:02:16

    注意要倒序。   设f[i]表示从第i时刻到第n时刻的最大休闲时间。   ```cpp #include<cstdio> #include<iostream> #include<vector> using namespace std; const int N=10005; int f[N]; int cnt[N]; vector<int> v[N]; int n,k; int main(){ scanf("%d%d",&n,&

  • Solution - 龙珠2021-09-11 19:34:49

    描述 \(link\) 有标号为 \(1\) 到 \(n\) 的 \(n\) 个龙珠,分别放在对应标号为 \(1\) 到 \(n\) 的 \(n\) 个城市里。 下面有两种操作: T A B 表示把 A 龙珠所在城市的所有龙珠都转移到 B 龙珠所在的城市中 Q A 表示查询 A ,需要知道 A 龙珠现在所在的城市,A 所在的城市有几颗龙珠,A 转

  • 恢复训练复习——luogu10032021-09-02 13:34:26

    没什么好说的一道题,就当过一遍了 #include<cstdio> #include<iostream> using namespace std; int n; int x[10005]; int y[10005]; int a[10005]; int b[10005]; int aim_x, aim_y; void init() { cin >> n; for (int i = 1; i <= n; i++) { cin

  • 1361:产生数(Produce)2021-08-30 13:01:17

    产生数 “位变换” 存在数组 1 #include<iostream> 2 #include<cstdio> 3 #include<queue> 4 using namespace std; 5 const int N=10005; 6 int n,k,r[20][2],exist[N],ans=1; 7 queue<int> q; 8 void cnt(){ 9 while(!q.empty()){ 10

  • poj 1035(水题,枚举)2021-08-19 13:32:09

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; char data[10005][20],t[20],ans[10005][20]; int cnt_ans,count; void cmp(){ int i,j,k,l; for(i=0;i<count;i++){ int len_d = strlen(data[i]);

  • 做题记录 Luogu P45502021-07-19 21:03:26

    P4550 收集邮票 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 概率期望。 #include<bits/stdc++.h> using namespace std; #define ll long long #define N 10005 int n; double f[N], g[N]; signed main() { scanf("%d", &n); for(int i = n - 1; i >= 0; i--) { f[

  • https://www.luogu.com.cn/problem/P13532021-07-13 14:33:51

    Archie 还是很水的 注意一下边界 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n,m; int d[10001]; int dp[10005][505]; int main(){ scanf("%d%d",&n,&m); for(int i=1;i<=n;

  • 厦大C语言上机 1392 数组的平衡2021-07-11 12:06:57

    1392.数组的平衡 时间限制: 1000 MS          内存限制: 65536 K          提交数: 11 (0 users)          通过数: 0 (0 users) 问题描述 写一个函数,计算一个整形数组A的中心分割点。假设某个分割点的下标为k,那么S1= A[1]+A[2]+…+A[k]

  • [并查集]A. 【例题1】【模板】并查集2021-07-09 08:00:35

    解析 这道题是一道冰茶姬的模板题, 不必多言, 直接上代码 Code #include <bits/stdc++.h> using namespace std; int n, m, z, x, y; int f[10005]; int find (int x) { while (x != f[x]) x = f[x] = f[f[x]]; return x; } int main () { scanf ("%d%d", &n, &m); fo

  • [SCOI2014]方伯伯的玉米田2021-05-26 21:05:35

    一开始看错题目惹,导致错过了这题的关键\(trick\) 考虑每次操作肯定都是一个\([k,n]\)的,证明贪心一下就好了。 那么考虑记\(f[i][k]\)为前\(i\)个数用了\(k\)次。 那么只要满足\(j < i \ and\ a_j + k_j <= a_i + k_i \ and\ k_j < k_i\)就能转移了。 由于前一个偏序关系是自然的

  • 1114 Family Property (25 point(s))2021-04-13 20:29:45

    1114 Family Property (25 point(s)) 并查集 题目 This time, you are supposed to help us collect the data for family-owned property. Given each person’s family members, and the estate(房产)info under his/her own name, we need to know the size of each family,

  • 2014联赛讲解2021-01-19 09:30:56

    好啊,好啊,我又一次爆掉了(我都不意外了) 比完赛T1,T2直接A,听讲后T3又A,于是改完了题。 文章目录 T1:联合权值代码(与上面公式不同,本质差不多) T2:寻找道路代码 T3:飞扬的小鸟70分DP100分DP代码 总结 T1:联合权值 对于一个点,和它距离为2的点只有爷爷和亲生兄弟,所以

  • 【HTML】HTML特殊字符大全2020-12-05 08:32:17

    使用方法:这些字符属于unicode字符集,所以,你的文档需要声明为UTF-8;下面符号列表的后面有两列编号,它们并不太一样,第一列是用于html的,你需要在前面加上&#符号;第二列可以用于CSS文件中,但是需要用反斜杠\转义;第二列也可以用于javascript,和CSS用法一样,不过要用\u来转义。需要主意的是:有的

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有