网站首页 站内搜索

搜索结果

查询Tags标签: stick,共有 6条记录
  • cf1514 D. Cut and Stick

    题意: 给定数组。q 次询问,每次问至少把 \(a[l,r]\) 拆成几个子序列,才能让每个子序列中的众数的出现次数 不大于子序列长度/2上取整 \(n,q\le 3e5, 1\le a_i\le n\) 思路: 绝对众数:出现次数严格大于N/2 如果区间众数不是绝对众数,则答案为1。否则,设绝对众数的出…

    2022/4/28 6:14:14 人评论 次浏览
  • 1167. Minimum Cost to Connect Sticks 一直选取最小值来拼棍子

    You have some number of sticks with positive integer lengths. These lengths are given as an array sticks, where sticks[i] is the length of the ith stick. You can connect any two sticks of lengths x and y into one stick by paying a cost of x + y. You m…

    2021/8/29 6:06:33 人评论 次浏览
  • 1167. Minimum Cost to Connect Sticks 一直选取最小值来拼棍子

    You have some number of sticks with positive integer lengths. These lengths are given as an array sticks, where sticks[i] is the length of the ith stick. You can connect any two sticks of lengths x and y into one stick by paying a cost of x + y. You m…

    2021/8/29 6:06:33 人评论 次浏览
  • Dance with a stick 题解(思维)

    题目链接 题目思路 居然是个imo题目链接 感觉应该不会再有了吧。。。。 结论就是经过某个点的直线,使得左右两侧的点个数相同 向量取\((-1,1e9)\) 代码 #include<bits/stdc++.h> #define fi first #define se second #define debug cout<<"I AM HERE&qu…

    2021/8/13 23:08:38 人评论 次浏览
  • Dance with a stick 题解(思维)

    题目链接 题目思路 居然是个imo题目链接 感觉应该不会再有了吧。。。。 结论就是经过某个点的直线,使得左右两侧的点个数相同 向量取\((-1,1e9)\) 代码 #include<bits/stdc++.h> #define fi first #define se second #define debug cout<<"I AM HERE&qu…

    2021/8/13 23:08:38 人评论 次浏览
  • Linux 文件特殊权限

    Linux 文件特殊权限 linux 中除了常见的:读(r)写(w)执行(x)权限外,还有三个特殊的权限,分别是:setuid、setgid、stick bit1. stick bit stick bit 只对目录有效,使目录下的文件,只有文件拥有者才能删除(如果不是拥有者,就算有w权限也不能删除) 添加方法: …

    2021/4/30 7:59:42 人评论 次浏览
扫一扫关注最新编程教程