
ACM
wxb_blog
语音识别算法工程师
展开
-
Surprising Strings
The D-pairs of a string of letters are the ordered pairs of letters that are distance D from each other. A string is D-unique if all of its D-pairs are different. A string is surprising if it is D-u原创 2013-10-05 10:01:05 · 835 阅读 · 0 评论 -
Adding Reversed Numbers
The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to transfigure some tragedi原创 2013-10-05 10:06:34 · 1426 阅读 · 0 评论 -
Magnificent Meatballs
Sam and Ella run a catering service. They like to put on a show when serving meatballs to guests seated at round tables. They march out of the kitchen with pots of meatballs and start serving adjacent原创 2013-10-05 10:49:23 · 789 阅读 · 0 评论 -
String Matching
It's easy to tell if two words are identical - just check the letters. But how do you tell if two words are almost identical? And how close is "almost"?There are lots of techniques for approximate原创 2013-10-05 13:47:54 · 865 阅读 · 0 评论 -
Crazy Tea Party
n participants of "crazy tea party" sit around the table. Each minute one pair of neighbors can change their places. Find the minimum time (in minutes) required for all participants to sit in reverse原创 2013-10-05 12:16:28 · 1435 阅读 · 1 评论 -
TJU Sequence
After the final exam, Shawn started to play a computer game SW. In the game, Shawn needs to make his equipments. Just like the pattern of most of other games, SW’s equipment can be improved by stone原创 2013-10-06 21:42:34 · 781 阅读 · 0 评论 -
TJU Vacation
Z is planning to visit the Tourist Kingdom for M days. This kingdom is full of lovely cities. During his stay Z would like to visit as many different cities as possible. He cannot visit more than on原创 2013-10-06 22:07:45 · 727 阅读 · 0 评论 -
TJU Change
After Shawn sees the following picture, he decides to give up his career in IT and turn to sell fruits. Since Shawn is a lazy guy, he doesn’t like to do any extra work. When he starts selling fruits,原创 2013-10-06 23:43:01 · 829 阅读 · 0 评论 -
Nuanran's Idol II
You have known that nuanran is a loyal fan of Kelly from the last contest. For this reason, nuanran is interested in collecting pictures of Kelly. Of course, he doesn't like each picture equally. So h原创 2013-10-06 10:36:02 · 1172 阅读 · 0 评论 -
TOJ A+B Problem
You know that the first problem of an online judge system should be the "A+B Problem", but TOJ not. What a terrible! So now it comes...Given a series of numbers, your task is to find the largest num原创 2013-10-06 15:28:39 · 1335 阅读 · 0 评论 -
TJU Count the factors
The ProblemWrite a program, that computes the number of different prime factors in a positive integer.The InputThe input tests will consist of a series of positive integers. Each number is on a原创 2013-10-07 19:10:05 · 857 阅读 · 0 评论 -
TJU Happy 2004
Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004X. Your job is to determine S modulo 29 (the rest of the division of S by 29).Take X = 1 for an example.转载 2013-10-07 20:12:27 · 844 阅读 · 0 评论 -
TJU Antimonotonicity
I have a sequence Fred of length n comprised of integers between 1 and n inclusive. The elements of Fred are pairwise distinct. I want to find a subsequence Mary of Fred that is as long as possible转载 2013-10-07 22:39:49 · 756 阅读 · 0 评论 -
TJU Price
Ant is a student in Tianjin University. Everyday, he has to go to the restaurant in school. Recently, some other students complain about the high price of restaurant dishes. Ant is a poor man, he do原创 2013-10-09 11:54:40 · 638 阅读 · 0 评论 -
TJU Super Square
If N Ns are added together, we know that it's the square of N. Well, if N Ns are multiplied together, we call it a super square of N. For example, the square of 3 is 3+3+3=9, while the super square原创 2013-10-10 22:31:42 · 1073 阅读 · 0 评论 -
C/C++中的64位整数(__int64 and long long)
在做ACM题时,经常都会遇到一些比较大的整数。而常用的内置整数类型常常显得太小了:其中long 和 int 范围是[-2^31,2^31),即-2147483648~2147483647。而unsigned范围是[0,2^32),即0~4294967295。也就是说,常规的32位整数只能够处理40亿以下的数。 那遇到比40亿要大的数怎么办呢?这时就要用到C++的64位扩展了。不同的编转载 2013-10-12 16:19:32 · 2305 阅读 · 0 评论 -
TJU Hacb knows the gift
Coach Yu will send gifts to ACM teammates. This message was known by Hacb, he send the message to G.D.R at once. But the message was encrypted. If Hacb wants to send an integer x to G.D.R, the massa原创 2013-10-12 22:05:48 · 915 阅读 · 0 评论 -
TJU Root of the Problem
Given positive integers B and N, find an integer A such that AN is as close as possible to B. (The result A is an approximation to the Nth root of B.) Note that AN may be less than, equal to, or g原创 2013-10-12 22:43:05 · 816 阅读 · 0 评论 -
TJU Counting Letters
As a talented student, your boss gave you a task. Given a text string, you should find out which letters appear most frequently.Really simple, isn't it?InputThe first line of the input is the nu原创 2013-10-12 23:03:18 · 1265 阅读 · 0 评论 -
TJU Easier Done than Said?
Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (原创 2013-10-13 20:56:58 · 1240 阅读 · 0 评论 -
TJU Bitwise Reverse
Professor Robby invents a powerful encryption method, but he is too lazy to implement it. So he turns to you for help.In fact, the encryption method is only applied to positive integers. At first, w原创 2013-10-13 19:12:21 · 1058 阅读 · 0 评论 -
关于scanf,printf以及c中字符串的一些总结
在做ACM题的时候,如果需要输入的数据量较大,一般都会提示使用scanf和printf来进行输入和输出。不可否认,这两个函数功能比cin和cout强大,而且效率更高。 在用scanf输入字符串的时候,它会忽略前面的空格,同时以遇到的 空格 作为字符串结束的标志。例如:读入 Join WTommy 80,会把这三个字符串分开读,而不会把它们都读到一个字符串内。哎,因为原创 2013-10-15 00:15:16 · 1845 阅读 · 0 评论 -
Change Base
Given an integer m in base B (2 ≤ B ≤ 10) (m contains no more than 1000 digits), find the value of the integer m in base 10, output the result modulo 10007.InputThe first line of the input is a原创 2013-10-15 21:20:25 · 1088 阅读 · 0 评论 -
Differences
CXB attended an interview and the interviewer given him a problem. The problem asked him to be in a sequence to find the difference between the maximum and minimum values.InputThe first line of th原创 2013-10-15 22:04:13 · 1098 阅读 · 0 评论 -
Degree
CXB would like to find out the maximum repeat frequency in a figure sequence. For instance, the figure sequence as follows: 5,6,7,5,1. According to this sequence, we can draw a conclusion that 5 is原创 2013-10-16 22:03:32 · 1087 阅读 · 0 评论 -
Just the Facts
The expression N!, read as "N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example, N N! 0 1 1 1 2 2 3原创 2013-10-16 22:40:49 · 1176 阅读 · 0 评论 -
Rounders
Introduction:For a given number, if greater than ten, round it to the nearest ten, then (if that result is greater than 100) take the result and round it to the nearest hundred, then (if that result原创 2013-10-17 13:02:05 · 1084 阅读 · 0 评论 -
Browsing History
Time Limit: 1000msCase Time Limit: 1000msMemory Limit: 32768KB64-bit integer IO format: %I64d Java class name: MainSubmit StatusFont Size: + -One day when you are goin原创 2013-10-18 12:00:35 · 1567 阅读 · 0 评论 -
I Think I Need a Houseboat
Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 3862 Accepted Runs: 1367Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of原创 2013-10-24 22:04:58 · 903 阅读 · 0 评论 -
Border
1649. BorderTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 655 Accepted Runs: 285You are to write a program that draws a border around a closed path into a bitmap, as原创 2013-10-24 23:22:07 · 1208 阅读 · 0 评论 -
Number Sequence
Given a positive integer number, we want to generate a number sequence with the following rules:If the current number is 1, the process will be terminated. Otherwise, if the current number is even,原创 2013-10-23 08:31:41 · 1029 阅读 · 0 评论 -
Speed Limit
Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 2602 Accepted Runs: 1751Bill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how man原创 2013-10-23 08:19:27 · 1322 阅读 · 0 评论 -
POJ 1306 Combinations
CombinationsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8013 Accepted: 3746DescriptionComputing the exact number of ways that N things can be taken原创 2013-10-29 22:01:48 · 1177 阅读 · 0 评论 -
动态规划一
什么是动态规划: 动态规划(dynamicprogramming)是运筹学的一个分支,是求解决策过程(decisionprocess)最优化的数学方法。20世纪50年代初美国数学家R.E.Bellman等人在研究多阶段决策过程(multistepdecision process)的优化问题时,提出了著名的最优化原理(principleof optimality),把多阶段过程转原创 2013-10-24 08:47:49 · 898 阅读 · 0 评论 -
java解ACM之求阶层
import java.util.*;import java.math.*;public class Main3 {public static void main(String args[]){Scanner cin=new Scanner(System.in);int n,i;BigInteger a,b;while(cin.hasNext()){n=ci原创 2013-11-03 23:59:34 · 1195 阅读 · 0 评论 -
自定义排序准则,自定义数据类型
#include#include#includeusing namespace std;typedef struct{ string name; int num; int punish;}Node;bool cmp(Node a,Node b){ if(a.num!=b.num)return a.num>b.n原创 2013-11-05 00:09:22 · 1408 阅读 · 1 评论 -
上一篇之注释篇
#include#include#includeusing namespace std;typedef struct{ string name; int num; int punish;}Node;bool cmp(Node a,Node b){ if(a.num!=b.num)return a.num>b.n原创 2013-11-05 00:12:41 · 1236 阅读 · 1 评论 -
10进制 VS 2进制
题目描述: 对于一个十进制数A,将A转换为二进制数,然后按位逆序排列,再转换为十进制数B,我们乘B为A的二进制逆序数。 例如对于十进制数173,它的二进制形式为10101101,逆序排列得到10110101,其十进制数为181,181即为173的二进制逆序数。输入: 一个1000位(即10^999)以内的十进制数。输出:原创 2013-11-20 11:26:52 · 1200 阅读 · 0 评论 -
翻转单词顺序
题目描述:JOBDU最近来了一个新员工Fish,每天早晨总是会拿着一本英文杂志,写些句子在本子上。同事Cat对Fish写的内容颇感兴趣,有一天他向Fish借来翻看,但却读不懂它的意思。例如,“student. a am I”。后来才意识到,这家伙原来把句子单词的顺序翻转了,正确的句子应该是“I am a student.”。Cat对一一的翻转这些单词顺序可不在行,你能帮助他么?输入:每原创 2013-11-20 11:29:07 · 1146 阅读 · 0 评论 -
手机键盘
题目1079:手机键盘时间限制:1 秒内存限制:32 兆特殊判题:否提交:1516解决:802题目描述:按照手机键盘输入字母的方式,计算所花费的时间如:a,b,c都在“1”键上,输入a只需要按一次,输入c需要连续按三次。如果连续两个字符不在同一个按键上,则可直接按,如:ad需要按两下,kz需要按6下如果连续两字符在同一原创 2013-11-21 13:08:52 · 1104 阅读 · 0 评论