Roy played a game with his roommates the other day. His roommates wrote 2 strings of characters, and gave each character a bonus value. When Roy pinned the positions of one common character in t
原创
2022-11-10 01:04:34
48阅读
嘟嘟嘟 看到最后让求一个比值,应该得往01规划上去想。令x = ∑v[i] / ∑c[i],则x * ∑c[i] = ∑v[i], ∑(v[i] - x * c[i]) = 0. 于是可以二分x(注意是实数二分),每一个点得到新的权值v[i] - mid * c[i],然后树上背包求最大值。如果最大
原创
2021-05-29 19:07:46
145阅读
题意:给出一个数列,求一个连续的子序列,使得MGCD(i, j) = 该子序列的长度(j-i+1) × 子序列的gcd 最大,并输出这个最大值。分析:感觉可能要用优先队列,但貌似也用不上。但类似地,从左往右枚举右端点,不难发现随着序列长度的增大,其子序列的最大公约数是非递增的。一般情况下,是呈阶梯状...
转载
2015-01-04 00:36:00
69阅读
2评论
目录一,数位DP二,OJ实战CSU 12: Problem BACdream - 1156LCP SUMBZOJ 2757: Blinker的仰慕者一,数位DP有一类奇特的DP问题,对象空间是一个
原创
2021-12-27 11:06:32
42阅读
题目链接:点击打开链接#include int main() { int n, s, x; while(~scanf("%d%d", &n, &s)) { int l = - 1000, r = 1000; for(int i = 0; i < n; i ++) { scanf("%d", &x); if(x l) l = x; if(x > 0 && x <
原创
2021-08-13 14:11:50
80阅读
Match for BonusTime Limit:2 Seconds Memory Limit:65536 KBRoy played a game with his roommates the other day.His roommates wrote 2 strings of characters, and gave each character a bonus value. When Roy pinned the positions of one common character in the 2 strings, the bonus value of that character wo
转载
2013-04-04 22:45:00
33阅读
2评论
链接发个长长的模拟 这题要注意的地方挺多 -的个数 以及对齐的情况 全都注意好了 大数的加减乘就可以了 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 #define N 510 11 char s1[N],s2[N]; 12 int s[N][N*2],o[N]; 13 int main() 14 { 15 int t,i,j,k1,k2,len; 16 char c,tc; 1...
转载
2014-02-15 21:06:00
51阅读
2评论
P1642班长的任务 背景 十八居士的毕业典礼(1) 描述 福州时代中学2009届十班同学毕业了,于是班长PRT开始筹办毕业晚会,但是由于条件有限,可能每个同学不能都去,但每个人都有一个权值,PRT希望来的同学们的权值总和最大。 十班有一个周密的电话通知网络,它其实就是一棵树,根结点为班长PRT,由
转载
2016-08-10 20:14:00
41阅读
2评论
大体题意:给你n 个整数(n 思路:按照刘汝佳分析做的,加入一个数后,给它的所有后缀的 #
原创
2023-05-15 00:58:15
26阅读
新手发帖,很多方面都是刚入门,有错误的地方请大家见谅,欢迎批评指正最长共公子串题问懂得的话。这个就不是题问了。水……zoj这类目题很多多少,都没有说数据范围……只能拼rp。。。。每日一道理 风,渐渐吹起,吹乱了我的发丝,也让我的长裙有些飘动。绿叶仿佛在风中起舞,离开了树,投向了大地,却不知这样会枯萎,我弯下腰,轻轻拾起一片树叶,那非常有序的茎脉,是一种美的点缀。我有些哀叹:绿叶啊,绿叶,你这般美丽地从树上轻轻飘下,随风起舞,却不知已被人称之为落叶!#include <cstdio>#include <cstring>#include <algorithm>u
转载
2013-05-05 22:11:00
39阅读
2评论
DescriptionYou are given an integer array heights representing the heights of buildings, some bricks, and some
转载
2022-08-11 17:29:46
55阅读
You are given an integer array heights representing the heights of buildings, some bricks, and some ladders. You start your journey from building 0 an
转载
2021-05-13 06:04:00
141阅读
2评论
$1642$:$Fibonacci$ 第 $n$ 项 解法I $$ \begin{pmatrix} f[i] & f[i+1] \end{pmatrix} = \begin{pmatrix} f[i-1] & f[i] \end{pmatrix} * \begin{pmatrix} 0 & 1\ 1
原创
2023-05-21 00:59:47
143阅读
编辑:@调皮连续波,保持关注调皮哥,获得更多学习内容和建议!各位大佬好,我是调皮哥,感谢大家的关注。因为疫情,有的人回不了学校的实验室,因此早在先前我就想为大家采集一些数据,提供给大家做算法分析和验证。正好,昨天为别人采数据,就多采集了一些。数据放在这里我也没有用,因此就准备分享给大家。具体的雷达参数配置在文件中有说明,数据总共有30个bin文件,有单人、双人的,还增加了男女生、呼吸快慢速进行对比
原创
2023-05-04 18:25:28
385阅读
1642: [Usaco2007 Nov]Milking Time 挤奶时间Time Limit:5 SecMemory Limit:64 MBSubmit:590Solved:337[Submit][Status][id=1642" style="color:blue; text-decorati...
转载
2015-10-13 21:16:00
42阅读
PAT (Advanced Level) Practice 1061 Dating
转载
2021-04-09 23:32:00
112阅读
2评论
PAT (Advanced Level) Practice 1003 Emergency (25 分) 凌宸1642 题目描述: As an emergency rescue team leader of a city, you are given a special map of your cou ...
转载
2021-04-14 00:18:00
136阅读
2评论
PAT (Advanced Level) Practice 1077 Kuchiguse (20 分) 凌宸1642 题目描述: The Japanese language is notorious for its sentence ending particles.
转载
2021-04-12 00:23:00
107阅读
2评论
Description
贝茜是一只非常努力工作的奶牛,她总是专注于提高自己的产量。为了产更多的奶,她预计好了接下来的N (1 ≤ N ≤ 1,000,000)个小时,标记为0..N-1。 Farmer John 计划好了 M (1 ≤ M ≤ 1,000) 个可以挤奶的时间段。每个时间段有一个开始时间(0 ≤ 开始时间 ≤ N), 和一个结束时间 (开始时间 <
结束时间 ≤ N),
转载
2014-08-01 22:22:00
28阅读
2评论
【BZOJ】1642: [Usaco2007 Nov]Milking Time 挤奶时间(dp)
原创
2021-08-11 11:43:30
56阅读