Software CRC - UVa 128 取模

NBU计算机大二下期末 计算机网络 任课老师:JG (放了一学期的他自己的视频和上了一学期网课没什么区别,甚至不如上网课。。。) 考试题型 填空题10*1 判断题10*1 选择题30*1 简答和计算题30(4题) 讨论题20 强烈建议不要再这门课上花太多时间复习,不然有复习了个寂寞的感觉。。。计网是一页开卷的,一页开卷纸不用写太多,第一他不会考太详细;第二反正最后都要被收走。 填空题、判断题基本看懂了英文就能做的差不多;选择题去网上找点英文题多刷一下问题不大;简答题把书上每章根据他上课的内容在开卷纸上抄下就好,今年是解释check 阅读详情

Software CRC

You work for a company which uses lots of personal computers. Your boss, Dr Penny Pincher, has wanted to link the computers together for some time but has been unwilling to spend any money on the Ethernet boards you have recommended. You, unwittingly, have pointed out that each of the PCs has come from the vendor with an asynchronous serial port at no extra cost. Dr Pincher, of course, recognizes her opportunity and assigns you the task of writing the software necessary to allow communication between PCs.

You've read a bit about communications and know that every transmission is subject to error and that the typical solution to this problem is to append some error checking information to the end of each message. This information allows the receiving program to detect when a transmission error has occurred (in most cases). So, off you go to the library, borrow the biggest book on communications you can find and spend your weekend (unpaid overtime) reading about error checking.

Finally you decide that CRC (cyclic redundancy check) is the best error checking for your situation and write a note to Dr Pincher detailing the proposed error checking mechanism noted below.

CRC Generation

The message to be transmitted is viewed as a long positive binary number. The first byte of the message is treated as the most significant byte of the binary number. The second byte is the next most significant, etc. This binary number will be called ``m'' (for message). Instead of transmitting ``m'' you will transmit a message, ``m2'', consisting of ``m'' followed by a two-byte CRC value.

The CRC value is chosen so that ``m2'' when divided by a certain 16-bit value ``g'' leaves a remainder of 0. This makes it easy for the receiving program to determine whether the message has been corrupted by transmission errors. It simply divides any message received by ``g''. If the remainder of the division is zero, it is assumed that no error has occurred.

You notice that most of the suggested values of ``g'' in the book are odd, but don't see any other similarities, so you select the value 34943 for ``g'' (the generator value).

Input and Output

You are to devise an algorithm for calculating the CRC value corresponding to any message that might be sent. To test this algorithm you will write a program which reads lines (each line being all characters up to, but not including the end of line character) as input, and for each line calculates the CRC value for the message contained in the line, and writes the numeric value of the CRC bytes (in hexadecimal notation) on an output line. Each input line will contain no more than 1024 ASCII characters. The input is terminated by a line that contains a # in column 1. Note that each CRC printed should be in the range 0 to 34942 (decimal).

Sample Input

this is a test

A
#

Sample Output

77 FD 
00 00
0C 86

题意:将一行的字符串转化成256进制,然后最后加两位,使得取模34942后为0,问这两位的16进制是多少。

思路:前面的取模之后,用34942减去这个数,就是最后求的结果。

AC代码如下:

#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
char s[1030],s2[10];
ll f,ret,MOD=34943;
int main()
{
    int i,j,k,len;
    while(gets(s))
    {
        if(s[0]=='#')
          break;
        len=strlen(s);
        if(len==0)
        {
            printf("00 00\n");
            continue;
        }
        f=0;
        for(i=0;i<len;i++)
           f=((f<<8) + s[i])%MOD;
        f=MOD-(f<<16)%MOD;
        for(i=4;i>=1;i--)
        {
            ret=f%16;
            if(ret<=9)
              s2[i]='0'+ret;
            else
              s2[i]='A'+ret-10;
            f/=16;
        }
        printf("%c%c %c%c\n",s2[1],s2[2],s2[3],s2[4]);
    }
}



从CT扫描到3D模型:手把手教你用NII文件在3D Slicer中重建脊柱(附Verse数据集实战) 本文详细介绍了如何利用NII文件在3D Slicer中从CT扫描数据重建脊柱3D模型的全流程,包括环境配置、数据获取、方向校准、结构分割和模型优化等关键步骤。通过Verse数据集实战演示,帮助医学从业者快速掌握医学图像处理技术,提升临床诊疗与教学效率。 阅读详情

相关推荐

COMSOL仿真避坑指南:列管反应器模拟中多孔介质与化学反应设置的5个常见错误

本文详细解析了COMSOL仿真中列管反应器模拟的5个常见错误,包括多孔介质模型选择、化学反应接口配置、对流扩散方程处理、薄层热阻设置及网格独立性验证。特别针对多孔介质与化学反应设置的误区,提供了实用的判断标准和修正方法,帮助工程师避免计算偏差,提升仿真精度。

weixin_29597551的博客 331

CRC原理

CRC远没有网上所说那么简单。     首先我们有一个数据流,也就是你需要校验的数据,可以是N BIT,一般我们常用的4,8,16,32,128 BIT,这里我取几个8的倍数,是因为我们的硬件以二进制为基础,所以在存取数据比较容易,无须充填位数来满足寄存器的要求。你用13,17,29 BIT也可以。   有一点你要记住的是,你选用几个BIT,那么在CRC编码就需要移位几次,8就是移位8次,

hehui211的专栏 1454

vislib_vex5:面向VEX V5的嵌入式视觉处理库

嵌入式视觉处理是机器人实时感知的核心能力,其本质是在资源受限环境下实现图像采集、色彩转换、阈值分割与目标定位的确定性流水线。原理上依赖硬件加速(如DMA2D)、定点运算优化与中断协同机制,以规避浮点开销和动态内存分配。技术价值在于提供亚毫秒级、无RTOS依赖、低延迟可预测的视觉基础能力,显著提升教育及竞赛机器人在动态场景下的响应鲁棒性。典型应用场景包括色块跟踪、目标居中控制、自动导航中的简易视觉伺服等。本文聚焦于专为VEX V5主控(STM32H743+图像协处理器)深度优化的轻量库vislib_vex5,

weixin_31185473的博客 610

ZJU164-Software CRC

[题目大意] 你在一家拥有很名个人计算机的公司上班。你的老板,Penny Pincher博士,想要把这些个人计算机联网,但是他又不想花钱买网卡。你无意中告诉了老板每台计算机出厂时就带有一个异步串行端口,老板当然把脑防动到这个不用花钱的解决方案上。于是指派你完成编写通信软件的任务,以实现计算机之间联网。 你阅读了许事美手通信的书籍,知道在传送及接收信息时容易产生错误。解决间题的典型的...

qq_41046189的博客 226

SmsForwarder v6.4.0 + Flask API 实战:5步搭建手机验证码自动化接收服务

本文详细介绍了如何利用SmsForwarder v6.4.0和Flask API构建企业级验证码自动化处理系统。通过5个关键步骤,包括系统架构设计、Android端配置、Flask服务端实现、企业级部署方案以及实战应用场景扩展,帮助开发者高效处理短信验证码,提升自动化测试和数据采集的工作效率。

weixin_30292745的博客 399

ENSP Pro VXLAN EVPN分布式网关部署配置

在BGP EVPN方式部署分布式网关的场景中,控制平面的流程包括VXLAN隧道建立、MAC地址动态学习;转发平面的流程包括同子网已知单播报文转发、同子网BUM报文转发、跨子网报文转发。该方式实现的功能全面,支持主机IP路由通告、主机MAC地址通告、主机ARP通告,可以直接使能ARP广播抑制功能。如果在VXLAN网络中采用分布式网关,推荐使用此方式。对比集中式网关,分布式网关的arp条目比集中式网关的arp条目少,分布式网关只学习租户侧的arp条目,不学习网络侧的arp条目。

qq2353177176的博客 4575

原码 反码 补码

原码 反码 补码 对于 原码、反码、补码的学习记录 对于概念的描述也是基于个人理解做出的易于理解的表达方式,没有使用更严谨的数学公式定义 只针对整数 只针对加法 个人是从高位为符号位+低位为数值位的角度去理解的 但是不引入符号位这个概念也完全可以理解这三个概念,那就是另一种表述了,没有深入了解 非科班出身,足够个人使用的个人理解,可能根本原理上会有理解错误,如有错误希望有大佬指正 1.机器数和真值 1.1 机器数 数字在计算机中的二进制表示形式,有以下两个特点 具有符号位,即二进制中的最

王二小的博客 704

使用同一个时钟源clki,做两个二分频时钟,得到div2_clk1和div2_clk2,这两个时钟都能跟源时钟clki同步,但是div2_clk1和div2_clk2的相位可能是相同的,也可能是反相

比如,触发器1的初始Q为0,而触发器2的初始Q为1(这可能由于芯片制造工艺的微小差异、上电过程的随机性、或没有全局复位信号导致)。这句话的意思是:虽然div2_clk1和div2_clk2都是由同一个妈妈(clki)生出来的,频率也都是妈妈的一半,但它们“起步”的时刻可能不同。所以,上面那段话是在提醒你注意这种潜在的、由分频产生的时钟相位关系的不确定性,这在异步电路设计或时钟管理中是必须考虑的关键因素。结果:div2_clk1和div2_clk2的波形完全重合,它们的上升沿和下降沿都发生在同一时刻。

m0_49540263的博客 600

原码, 反码, 补码 详解

原码, 反码, 补码 详解 本篇文章讲解了计算机的原码, 反码和补码. 并且进行了深入探求了为何要使用反码和补码, 以及更进一步的论证了为何可以用反码, 补码的加法计算原码的减法. 论证部分如有不对的地方请各位牛人帮忙指正! 希望本文对大家学习计算机基础有所帮助! 一. 机器数和真值 在学习原码, 反码和补码之前, 需要先了解机器数和真值的概念. 1、机器数 一个数在计算机中的二进制表示形式, 叫做这个数的机器数。机器数是带符号的,在计算机用一个数的最高位存放符号, 正数为0, 负数为1. 比如,十进制中的

weixin_45839498的博客 2859

MiniMax H3 + ComfyUI 工作流搭建指南:从整合包到视频生成

AI视频生成正成为内容创作的新基础设施,而ComfyUI作为可视化工作流引擎,将复杂的模型推理过程拆解为节点与连线,让本地视频生成变得可复用、可批量。理解这一原理后,用户无需编写代码,只需掌握模型加载、提示词控制、采样与解码的基本链路,即可搭建出稳定的视频生产管线。MiniMax H3作为前沿视频生成模型,在ComfyUI中通过权重文件和自定义节点落地,配合整合包可大幅降低环境配置门槛。从硬件评估、目录结构到节点连接与参数调优,本文系统性梳理了从零跑通一条视频生成工作流的完整路径,帮助用户在批量素材生成、风

weixin_29057065的博客 431

vue2/3 - 【超详细】最新网站接入使用支付宝支付功能,点击支付跳转新页面后生成订单及支付二维码,实现支付宝在线付款详细的教程(整个支付的完整配置及支付流程,一键复制源码开箱即用)!

vue支付宝付款,vue支付宝支付,vue如何实现支付宝在线付款,vue网页pc项目接入支付宝支付,vue支付宝支付详细教程,vue2支付宝在线支付的详细示例代码,vue如何做支付宝付款,vue怎么实现支付宝的付款功能,vue调用支付宝进行付款支付,vue PC项目实现 支付宝支付,vue h5页面调用支付宝支付,vue页面唤起支付宝支付功能,vue支付宝支付跳转到新页面,vue如何跳转新开一页展示支付宝二维码支付,vue怎么新开页面进行支付宝在线支付,vue新页面支付宝支付功能,前端vue支付宝支付教程,

✅ 精选推荐文章 5737

UVA 128 Software CRC(数论 进制转化)

Software CRC  You work for a company which uses lots of personal computers. Your boss, Dr Penny Pincher, has wanted to link the computers together for some time but has been unwilling to

Remilia's 1333

记住这两个纯净版Windows11各系列版本系统下载网站

记住这两个纯净版Windows11各系列版本系统下载网站 HelloWindows是一个完整极致的Windows纯净系统下载站,不夹带任何私货,系统全部来源于微软官方原版,本站只是收录官方发布的系统以及工具,方便大家下载,请放心使用。永久在线:www.hellowindows.cn。HelloWindows.cn - 精校 完整 极致 Windows系统下载仓储站。

拥抱具身智能,昇腾Ascend C 7219

UVA128 - Software CRC(大数取模)

UVA128 - Software CRC(大数取模) 题目链接 题目大意:给你一个字符串,这个字符串代表的是256进制的一个数,要求在这个字符串后面再加上两个两个字节,使得这个新的字符串的值取模于34943等于0.最后要求你输出这两个字节(十六进制)。 解题思路:256进制的数先转化成十进制的数m,然后求出还需要的数n使得(n + m)%34943 ==0 ,最后再将n转换成1

789

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

UVa 128 Software CRC

本文介绍了如何为异步串行通信设计CRC校验算法。题目要求为给定消息计算16位CRC值,使得附加CRC后的消息能被生成器g=34943整除。算法核心是将消息视为二进制大整数,通过模运算避免直接处理超大数值。具体步骤包括预处理模幂数组、从最低字节开始逐字节累加计算余数,最后求补得到CRC值。代码实现展示了如何高效处理输入并输出两字节十六进制CRC值,适用于不超过1024字符的ASCII消息。样例演示了算法正确性,空行和单字符输入均能正确处理。该方案以低成本实现了可靠的通信错误检测。

寂静山林 996

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

uva 128 - Software CRC(进制转换)

题目链接:uva 128 - Software CRC 题目大意:给出一个字符串,表示一个256进制的数(因为char类型表示的字符范围),现在要再这个256进制的数后面加两位数值,使得新的数可以被十进制数g = 34943整除,输出添加两位数的16进制。 解题思路:在原先的数的基础上加两位,比如加的两位数为x, 原先的数为y,那么新组成的数就为(y * 256 * 256 +

不慌不忙、不急不躁 1898

uvaoj 138 Software CRC 大数取模

uvaoj 138 Software CRC 大数取模 求循环冗余检验(CRC)的值,循环冗余检验在计算机网络中应该提到过,计算的方法差不多。不过这里固定了要在后边加上2个字节的数,加上两个字节后,就组成了一个很大的整数,这个整数要处理34943为0,我们就设计算出来的检验位为x,原数为n,那么合起来的数为m=(n 代码如下: /*******************************

gwq5210的专栏 654

UVA 128 - Software CRC

给出一串字符串,求其循环冗余校验码. 求法:把整个字符串看成一个整数m,第一个字符作为这个整数的最高字节,第二字作为次高字节. etc... 要求在这个整数最后加上两个字节变成m2,使其整除34943. 解法:快速幂取模,粒度为一个字节. #include #include using namespace std; #define MOD 34943 char message[1025

蚂蚁大战大象 849

uva 128 Software CRC

题意: 输入一串256种字符的字符串(即256进制),求增加两位,使得这个串%34943的值为0 思路; 首先将串转化为256进制并且取余,然后前进两位,得到m+n%34943为0,也就是m=-n 为了使得到的数为整数,所以取34943-n,最后还要%一次保证不大与34943 (a+b)%m = (a%m+b%m)%m 代码: #include #include using name

deepquiet的博客 527

UVa 128 - Software CRC

题目:CRCjiaoyan 分析: 说明:

小白菜又菜 840

UVA 128 Software CRC

UVA_128     模运算。 #include&lt;stdio.h&gt;#include&lt;string.h&gt;#define MAXD 1200int a[5], g = 34943;char b[MAXD], *str = "0123456789ABCDEF";void solve(){ int i; long long int k, res; k =...

weixin_34121282的博客 87

UVa 128 Software CRC (模计算&CRC循环冗余校验码)

128 - Software CRC Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=64 You work for a company which uses lot

AC,∑ndless 1316

UVA128- Software CRC

题意:给一个字符串,每个字符占一个字节(即256进制数),在后面加两个字节,使得其模34943余数为0  思路:将

懒人一枚。 699

UVa 128 Software CRC 数论(模运算)

题意:给你一个字符串(可能有空格,最多1024字符),每个字符代表一个数字,因为最多有256个字符,所以这个字符串其实是表示一个256进制的数字。但这还没完,在这个256进制数字要再加两位,组成一个新的256进制数字,这个数字要能被g=34943(这是个十进制数字)整除,要你输出新添加的那两个数字是什么,这两个数字要以16进制的形式输出,用空格隔开   这题挺水的吧。。就是可以想象(只是想象,

xuruoxin的专栏 1291

uva 128 - Software CRC

<br />//看不懂题目,百度看到题意后做: //题目大意:给你一个字符串,每个字符占一个字节(即256进制数), //在后面加两个字节,使得其模34943余数为0 //from:http://iamhuangguan.blog.163.com/blog/static/124497319201010118113595 //输出你要加的数,十六进制输出 #include <iostream> #include <string> using namespace std; #define MOD

alfredtofu的专栏 1252

UVA - 128 Software CRC 256进制

题目大意:给你一个字符串,要求你将其转换成数字,这个数字是256进制的,因为这样才能区分出每一位,然后在这个数字的后面添加上两位,使得这个数能被34943整除 解题思路:按位除下去,得到最后一个余数,这个余数是倒数第三位的,所以这个数要乘上256*256,得到了这个数了,再做除法运算,得到一个余数,加上这个余数后,这个数就能被34943整除了 #include #include char *n

静静地码 1130
上一篇: Tennis Game - CodeForces 497 B
下一篇: Fermat vs. Pythagoras - UVa 106 勾股数
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值