摘要: 目录 Description State Input Output Solution Code Description 有 \(n\) 条纵向街道, \(m\) 条横向街道,\(k\) 个人在这些街道上,求有几对人相遇所走的路程大于其曼哈顿距离 State \(2<=n,m<=2*10^5\) \( 阅读全文
posted @ 2021-09-14 19:09 Bcoi 阅读(71) 评论(0) 推荐(1)
摘要: 目录 Description State Input Output Solution Code Description 将一个数分解成多个数之和,使得这些数的乘积最大 State \(10<=n<=31000\) Input 13 Output 3 108 Solution 前置结论:将数 \(x\ 阅读全文
posted @ 2021-09-12 17:02 Bcoi 阅读(73) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 从一个长度为 \(n\) 的序列中,找到只出现一次的子序列,输出总个数 State \(1<=n<=2*10^{5}\) \(1<=a[i]<=n\) Input 12 1 2 3 阅读全文
posted @ 2021-09-11 09:05 Bcoi 阅读(143) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 要求构造一个长度为 \(n\) 的排列,已知排列中最长上升子序列为 \(k\) ,求字典序最小的排列方式 State \(1<=n,k<=2*10^{5}\) \(1<=a[i]< 阅读全文
posted @ 2021-09-10 16:19 Bcoi 阅读(116) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 计算 \(x^2-y=a\) ,其中 \(a\) 为任意平方数,\(1<=x,y<=n\), 输出答案有多少种 State \(1<=n<=10^{12}\) Input 10 1 阅读全文
posted @ 2021-09-10 14:17 Bcoi 阅读(86) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 有 \(n\) 个字符串,第 \(i\) 次操作,可以将这 \(n\) 个字符串的第 \(i\%|s|\) 个字符依次发送形成一个新的无限长字符串,在这个新字符串上找到最短区间包含 阅读全文
posted @ 2021-09-09 11:47 Bcoi 阅读(66) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 从 \(n\) 个数中找到两个数,使得 \(|a[i]+a[j]|\) 最小,若有多个最小值,\(i+j\) 最小优先(\(i!=j\)),输出这两个值 State \(1<=n< 阅读全文
posted @ 2021-09-09 10:02 Bcoi 阅读(30) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 有两种操作: \(1 \ L\ R\):对于每个数 \(a[i]=a[i]+lowbit(a[i])\) \(2 \ L\ R\):查询区间 \([L,R]\) 的值 State 阅读全文
posted @ 2021-09-08 16:35 Bcoi 阅读(82) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 有 \(n\) 个城市,\(m\) 条无向边,每条边都有一个权值 \(k\); 之后 \(Q\) 次强盗来袭,只有边权大于等于 \(x\) ,这条边才可以不受伤害,求每次强盗来袭可 阅读全文
posted @ 2021-09-08 08:24 Bcoi 阅读(136) 评论(0) 推荐(0)
摘要: 目录 Description State Input Output Solution Code Description 由 \(n\) 行 \(01\) 串, 其中有 \(m\) 个区间 \([l,r]\) 内的字符为 \(1\); 如果两行之中有任意一个位置 \(x\), 都为 \(1\), 那么 阅读全文
posted @ 2021-09-03 19:45 Bcoi 阅读(54) 评论(0) 推荐(0)