突然有打算记录一下做过的题目,目前为止都是很简单的题,还请多多指教。
题目来自ZOJ 2812 链接
题目
A checksum is an algorithm that scans a packet of data and returns a single number. The idea is that if the packet is changed, the checksum will also change, so checksums are often used for detecting transmission errors, validating document contents, and in many other situations where it is necessary to detect undesirable changes in data.
For this problem, you will implement a checksum algorithm called Quicksum. A Quicksum packet allows only uppercase letters and spaces. It always begins and ends with an uppercase letter. Otherwise, spaces and letters can occur in any combination, including consecutive spaces.
A Quicksum is the sum of the products of each character’s position in the packet times the character’s value. A space has a value of zero, while letters have a value eq

本文介绍了ACM竞赛中ZOJ 2812题目的Quicksum算法,讲解了如何计算一个字符串的Quicksum值,包括算法原理、输入输出格式及难点分析,并提供了实现代码。
最低0.47元/天 解锁文章
258

被折叠的 条评论
为什么被折叠?



