1. 一个数的从右起第p1位和第p2位swap n位 unsigned int swapBits(unsigned int x, unsigned int p1, unsigned int p2, unsigned int n) { unsigned << n) - ); unsigned << n) - ); unsigned int xored = set1 ^ set2; //same is 0, different is 1 xored = (xored <<…
C. String Manipulation 1.0 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 codeforces.com/problemset/problem/91/B Description One popular website developed an unusual username editing procedure. One can change the username only by deleting some characte…
ACM(Array Complicated Manipulation) Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 513 Accepted Submission(s): 104 Problem Description Given an infinite array of integers 2,3,.... Now do som…
WIKI Bit manipulation is the act of algorithmically manipulating bits or other pieces of data shorter than a word. Computer programming tasks that require bit manipulation include low-level device control, error detection and correction algorithms, d…
The Boost.StringAlgorithms library provides many free-standing functions for string manipulation. 1. converting strings to uppercase #include <boost/algorithm/string.hpp> #include <string> #include <iostream> using namespace boost::algor…
这篇BLOG是我很早以前写的,因为现在搬移到CNBLOGS了,经过整理后重新发出来. 工作之前的几年一直都在搞计算机安全/病毒相关的东西(纯学习,不作恶),其中PE文件格式是必须知识.有些PE文件,比如驱动,系统会在加载时对checksum进行校验,确保驱动文件的完整性.关于PE文件如何校验,网上有很多资料可以学习,这里有一篇文章<An Analysis of the Windows PE Checksum Algorithm>是对WINDOWS API CheckSumMappedFile…