会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
towboat
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
9
10
11
12
13
14
15
16
17
···
54
下一页
2023年4月25日
Moving to Nuremberg UVA12223
摘要: 题目大意:给出n,一个无根的树,每条边上都有权值。 现在每个位置都有一个景点,一个人想在一年之内去cnt[ i ] 次景点,所以接下来给出m,表示说在m个位置上有这个人想去的地方,给出位置以及想去的次数(注意,每去一个景点都要返回自己的住处),namo这个人该住在哪里走的路程才最短。 换根dp #i
阅读全文
posted @ 2023-04-25 13:05 towboat
阅读(34)
评论(0)
推荐(0)
2023年4月24日
Fast Food UVA - 662
摘要: 政府在某山区修建了一条道路,恰好穿越总共m个村庄的每个村庄一次,没有回路或交叉,任意两个村庄只能通过这条路来往。已知任意两个相邻的村庄之间的距离为di(为正整数),其中,0<i<m。为了提高山区的文化素质,政府又决定从m个村中选择n个村建小学(设0<n≤m<500)。请根据给定的m、n以及所有相邻村
阅读全文
posted @ 2023-04-24 22:11 towboat
阅读(33)
评论(0)
推荐(0)
UVA607
摘要: 每节课的长度为 L,有N个主题,讲每个主题的时间分别是 t1,t2,t3..., 每个主题必须在一节课讲完,不能分两节课。一节课可以将多个主题讲完每节课上完有不满意度。 在所需课程数量最少的前提下,求最小不满意度。 #include <iostream> #include <cstring> #in
阅读全文
posted @ 2023-04-24 21:11 towboat
阅读(39)
评论(0)
推荐(0)
Prime Distance UVA - 10140
摘要: 定两个整数 L,R , 求闭区间 [L,R] 中相邻两个质数差值最小的数对与差值最大的数对。 当存在多个时,输出靠前的素数对。 筛 1e6 每个素数,在区间里标记倍数, 类似的还有 https://www.luogu.com.cn/problem/P1835 #include<iostream> #
阅读全文
posted @ 2023-04-24 15:58 towboat
阅读(58)
评论(0)
推荐(0)
Movie collection UVA - 1513
摘要: 有n个影碟,标号为1~n,位置为0~n-1,每次取出一个影碟看完后,将其放在最前面(标号为0处),问每个影碟取出前,其位置之前有多少个影碟 开2倍数组, "i放置前面" 这个操作 add(i,-1) ,add(newi,1) #include<iostream> #include<cstring>
阅读全文
posted @ 2023-04-24 15:29 towboat
阅读(60)
评论(0)
推荐(0)
Prime k-tuple UVA - 1404
摘要: 一个步骤: 在[ a, b] 中标记 S 的倍数 #include<iostream> #include<cstring> #include<algorithm> #include<vector> using namespace std; const int N=1e5+20; const int
阅读全文
posted @ 2023-04-24 13:56 towboat
阅读(55)
评论(0)
推荐(0)
2023年4月23日
The Bells are Ringing UVA-12119
摘要: 已知M 为T1,T2,T3 的LCM 输出满足 Ti-Tj<=25 的所有可能情况 #include<iostream> #include<cmath> #include<algorithm> #include<cstring> using namespace std; const int N= 1
阅读全文
posted @ 2023-04-23 23:29 towboat
阅读(57)
评论(0)
推荐(0)
UVA11014
摘要: 给定一个NxNxN的正方体,求出最多能选几个整数点。使得随意两点PQ不会使PQO共线。 F(k) #include<iostream> #include<cmath> #include<algorithm> using namespace std; const int N=5e5; #define
阅读全文
posted @ 2023-04-23 19:43 towboat
阅读(50)
评论(0)
推荐(0)
Gauss Prime UVA - 1415
摘要: #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=5e4; int b[N+2], pm[N+2],tot=0; void init(){ b[1]=1; for(int
阅读全文
posted @ 2023-04-23 17:48 towboat
阅读(44)
评论(0)
推荐(0)
2023年4月21日
Counting Rectangles UVA - 10574
摘要: 给出n个点。问选出4个点作为定点,能够组成多少个平行与坐标轴的矩形。 点按照x排序 n^2挑选出 垂直x轴的线段,按照y1排序 #include<iostream> #include<cstring> #include<algorithm> #include<vector> using namesp
阅读全文
posted @ 2023-04-21 23:03 towboat
阅读(54)
评论(0)
推荐(0)
上一页
1
···
9
10
11
12
13
14
15
16
17
···
54
下一页
公告