上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 54 下一页
  2023年7月22日
摘要: 。每个人都有一个考试等级,教室里面一共有N个课桌,按照顺序排成一列,每个课桌可以坐两个人,记他们的能力等级为(A[i],B[i])。 现在决定对能力等级为K的人进行测验。从这N排中选择连续的L排进行测验,要求这L排中的每一排至少有一个人考试等级为K。 现在想知道L的最大值以及对应的等级K。 #inc 阅读全文
posted @ 2023-07-22 12:52 towboat 阅读(13) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct hp{ int ai,bi,ci; }a[1005]; bool cmp(hp a,hp b){ 阅读全文
posted @ 2023-07-22 11:29 towboat 阅读(13) 评论(0) 推荐(0)
  2023年7月4日
摘要: 一个无向图,现在对于每个点对 i, j 连接一条边z( 整数) , 满足 z= d [i ][j ] ,d[i][j] 为已知 问有多少种方案 mod (m 阅读全文
posted @ 2023-07-04 15:05 towboat 阅读(17) 评论(0) 推荐(0)
  2023年7月2日
摘要: 求解 a^x≡b (mod c) ( x<c ) siz = sqrt( c ) a^( i*siz + j) ≡b (mod c) a^j ≡ a^( - i* siz) *b (mod c) 枚举 j , 将 (j, a^j %c ) 存入map ; 枚举 i, 查询map的值 ( a^(-i 阅读全文
posted @ 2023-07-02 16:46 towboat 阅读(9) 评论(0) 推荐(0)
  2023年7月1日
摘要: def. 对任意(a,b) , 存在x,y, 满足 ax+by= gcd(a,b) > ax+by 一定是gcd(a,b) 的倍数 阅读全文
posted @ 2023-07-01 20:35 towboat 阅读(9) 评论(0) 推荐(0)
  2023年6月30日
摘要: void solve(){ int r=a[1].r; int i=2, mx=0, ans=1; while(r<len){ mx=r; while(a[i].l<=r&&i<=len){ mx=max(mx,a[i].r); i++; } ans++ ; r=mx; } cout<<ans-1< 阅读全文
posted @ 2023-06-30 23:53 towboat 阅读(12) 评论(0) 推荐(0)
摘要: 首先注意 2* n 的长度 mx: 当前匹配到的最大长度 即 [1,mx] id: mx 对应的中心点 pi : s[i] 为中心的回文串的最大长度, pi /2 -1 是半径() #include <iostream> #include <cstring> #include <algorithm> 阅读全文
posted @ 2023-06-30 21:46 towboat 阅读(12) 评论(0) 推荐(0)
  2023年6月27日
摘要: https://www.luogu.com.cn/problem/P1253 区间赋,区间加,查询区间最大值 阅读全文
posted @ 2023-06-27 23:01 towboat 阅读(60) 评论(0) 推荐(0)
摘要: 首先是代码量小的bit 值域上建立bit, 需要注意合并类型应该有单调性 https://www.luogu.com.cn/problem/AT_dp_q https://www.luogu.com.cn/record/133869096 线段树 值域上建立线段树,区间查询,单点改 #include 阅读全文
posted @ 2023-06-27 00:22 towboat 阅读(166) 评论(0) 推荐(0)
  2023年6月22日
摘要: 可持久化线段树 #include <cstdio> #include <algorithm> using namespace std ; const int maxn=200010; int a[maxn],b[maxn],blen,n,CNT; int sum[maxn<<5],lc[maxn<< 阅读全文
posted @ 2023-06-22 15:00 towboat 阅读(18) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 54 下一页