ACM
文章平均质量分 60
白鹿贞松
宁鸣而死,不默而生
展开
-
HBU省赛选拔——7-8 均方误差
给定一个长度为N的序列A, 求输入格式:输入一个整数n(2<=N<=3×105),接下来输入n个整数, 代表序列A(∣Ai∣<=200)的值.输出格式:输出r的值输入样例:32 8 4输出样例:56原创 2021-05-08 21:52:46 · 127 阅读 · 0 评论 -
HBU省赛选拔——7-7 加密信息---hard version
给定一个长度为n(n<=5×105)的加密字符串S,解密方式如下:1.初始时字符串T为空.2.从头遍历S字符串,令i=1,2,3…,n, 若S的第i个字符是R,那么翻转T字符串,否则将该字符加入T串中.3. 在上述操作结束后,若T串有两个连续的字符相同, 那么就删除这两个字符,直到T串中没有两个相同的连续字符为止.那么T串就是最终解密完毕的字符串.输入格式:输入一个加密字符串SS输出格式:输出最后解密完毕的字符串TT输入样例1:ozRnonnoe输出样例1:zone原创 2021-05-08 17:08:00 · 135 阅读 · 0 评论 -
HBU省赛选拔——7-6 加密信息---easy version
给定一个长度为n(n<=5×105)的加密字符串S,解密方式如下:1.初始时字符串T为空.2.从头遍历S字符串,令i=1,2,3…,n, 若S的第i个字符是R,那么翻转T字符串,否则将该字符加入T串中.那么T串就是最终解密完毕的字符串.输入格式:输入一个加密字符串SS输出格式:输出最后解密完毕的字符串TT输入样例1:ozRnonnoe输出样例1:zononnoe样例解释:● 初始时T为空z加入T中● 将z加入T中, 此时T是z●将o加入T中, 此时T是z原创 2021-05-08 16:58:32 · 127 阅读 · 1 评论 -
HBU省赛选拔——变异的勾股定理
设直角三角形的两条直角边长度分别是 和a,b斜边长度是c,那么可以用数学语言表达:a2+b2=c2,这就是勾股定理,但是在本题中, 勾股定理它!变!异!了!,若三个数满足a2+b2=c,那么称该数满足变异的勾股定理, 现在给定一个数c,如果存在两个数a与b满足a2+b2=c,那么输出Yes,否则输出No.数据范围:c<=231−1输入格式:输入一个整数c输出格式:输出Yes或No输入样例1:5输出样例1:在这里给出相应的输出。例如:Yes输入样例2:2147483原创 2021-05-08 15:49:29 · 95 阅读 · 0 评论 -
2019ACM河北省省赛——Paper Plane Fly Away
There are n boys, indexed from 1 to n, and n girls indexed from n+1 to 2n.One day, they have a party together. The girls are seated in the first row, and the boys sit in the second row. They take their seat in such a way, that a boy sit just behind a girl原创 2021-03-06 23:47:06 · 448 阅读 · 1 评论 -
2019ACM河北省省赛——分治
链接:https://ac.nowcoder.com/acm/contest/903/C来源:牛客网题目描述你是DEEP国的大军师,辅佐一个非常有野心的国王,这位国王非常有野心,他计划攻占 n 个国家。在地图上,这些国家排成一行。探子已经查明,当攻打一个国家 i 时,为了防止国家间的联合对抗,需要给该国家周围,所有未被攻占的国家支付costi个金币,即对于国家 i,它左侧第一个已被攻打的国家为 l,右侧第一个已被攻打的国家为 r,则他需要给[l+1,i-1] 和 [i+1,r-1] 之间的国家支付金原创 2021-03-02 23:44:07 · 281 阅读 · 0 评论 -
2019ACM河北省省赛——Battle of Balls
题目描述Now that you have a ball of radius r, you want it to go from the bottom boundary of the map to the top boundary of the map (starting and ending points can be considered outside the map, entering the map from the bottom boundary and leaving the map fro原创 2021-02-27 22:36:38 · 212 阅读 · 0 评论 -
2019ACM河北省省赛——Icebound and Sequence
题目描述Icebound hates math. But Imp loves math. One day, Imp gave icebound a problem.The problem is as follows.For given q,n,p, you need to help icebound to calculate the value of S.输入描述:The first line contains an integer T, denoting the number of test c原创 2021-02-27 17:39:48 · 103 阅读 · 0 评论