上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 54 下一页
  2023年4月24日
摘要: 每节课的长度为 L,有N个主题,讲每个主题的时间分别是 t1,t2,t3..., 每个主题必须在一节课讲完,不能分两节课。一节课可以将多个主题讲完每节课上完有不满意度。 在所需课程数量最少的前提下,求最小不满意度。 #include <iostream> #include <cstring> #in 阅读全文
posted @ 2023-04-24 21:11 towboat 阅读(9) 评论(0) 推荐(0)
摘要: 定两个整数 L,R , 求闭区间 [L,R] 中相邻两个质数差值最小的数对与差值最大的数对。 当存在多个时,输出靠前的素数对。 筛 1e6 每个素数,在区间里标记倍数, 类似的还有 https://www.luogu.com.cn/problem/P1835 #include<iostream> # 阅读全文
posted @ 2023-04-24 15:58 towboat 阅读(33) 评论(0) 推荐(0)
摘要: 有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 阅读(38) 评论(0) 推荐(0)
摘要: 一个步骤: 在[ 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 阅读(29) 评论(0) 推荐(0)
  2023年4月23日
摘要: 已知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 阅读(26) 评论(0) 推荐(0)
摘要: 给定一个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 阅读(15) 评论(0) 推荐(0)
摘要: #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 阅读(16) 评论(0) 推荐(0)
  2023年4月21日
摘要: 给出n个点。问选出4个点作为定点,能够组成多少个平行与坐标轴的矩形。 点按照x排序 n^2挑选出 垂直x轴的线段,按照y1排序 #include<iostream> #include<cstring> #include<algorithm> #include<vector> using namesp 阅读全文
posted @ 2023-04-21 23:03 towboat 阅读(20) 评论(0) 推荐(0)
摘要: 给你一个递增序列的第一位a1,最后一位an,求有多少个序列满足: 以a1为首,an为尾 1、B(1) = A(1) 2、后面每项满足 A[j]=B[j], A(j-1) < B(j) ≤ A(j), 且bj能整除A(j) - A(j-1)。 F[ i ] [ j ] 最后一位为j 的方案数 #inc 阅读全文
posted @ 2023-04-21 22:09 towboat 阅读(37) 评论(0) 推荐(0)
摘要: const int N =1e5+4; int fac[N] ,fm[N]; inline int kpow(int a, int b) { int res = 1; for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % m 阅读全文
posted @ 2023-04-21 16:56 towboat 阅读(288) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 54 下一页