摘要: 囧。 同样的题目在PKU上过了。 HOJ上总是超时。。。http://poj.org/problem?id=2493istringstream 可将整行字符串由空格分开成一个个连续字符串。 代码如下:#include<iostream>#include<sstream>#include<algorithm>#include<map>#include<cstdio>using namespace std;int main() { int se; cin >> se; for (int c = 1; c <= se; c 阅读全文
posted @ 2011-06-16 00:27 归雾 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 暴力过的。。 与限时只差0.03s。。。 Automatic Correction of MisspellingsTime limit:2sec.Submitted:30Memory limit:64MAccepted:17 Source: Ulm 2006Some text editors offer a feature to correct words which seem to be written incorrectly. In this problem you are asked to implement a simple Automatic Correction of Misspe 阅读全文
posted @ 2011-06-15 17:03 归雾 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 通过位运算将所有组合列出后 搜索。 CrabblesTime limit:5sec.Submitted:45Memory limit:32MAccepted:32 Source: Waterloo Local Contest Feb. 25, 2006Jennifer is practicing for a Crabbles tournament. She pulls out a handful of Crabbles tiles out of a bag, and tries to form the word with the highest possible score. Each til 阅读全文
posted @ 2011-06-15 14:03 归雾 阅读(268) 评论(0) 推荐(0) 编辑
摘要: string中 find, rfind, substr, insert函数的运用。 Defining MomentTime limit:1sec.Submitted:86Memory limit:64MAccepted:47 Source: South Central USA 2005As a homework assignment, you have been tasked with creating a programthat provides the meanings for many different words. As you dislikethe idea of writing 阅读全文
posted @ 2011-06-15 10:33 归雾 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 用stl stack实现中缀转后缀及后缀运算。转换之前将缺少的操作数补0。 Single Digit AdderTime limit:1sec.Submitted:197Memory limit:32MAccepted:45 Source: The 2005 ACM Pacific Northwest Programming ContestWrite a program that can evaluate expressions from the following roughly BNF (Backus NaurForm) grammar:expr ::= term | expr ‘+’ t 阅读全文
posted @ 2011-06-15 00:41 归雾 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 读取存储与处理子串。 stl list 和 stack实现。 Pasting StringsTime limit:1sec.Submitted:25Memory limit:32MAccepted:15 Source: Mid-Atlantic 2005You are part of a team implementing an HTML editor and have been tasked with the problemof implementing the cut/copy/paste functions. One of your goals is to preserve the fo 阅读全文
posted @ 2011-06-14 23:14 归雾 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 简单题。在输入的text段中提取只有字母的单词。(效率不高)求最大公约数化简。 Bullshit BingoTime limit:1sec.Submitted:99Memory limit:32MAccepted:46 Source: University of Ulm Internal Contest 2005Bullshit Bingo is a game to make lectures, seminars or meetings lessboring.Every player has a card with 5 rows and 5 columns. Each of the 25 ce 阅读全文
posted @ 2011-06-10 23:40 归雾 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 用stl list实现字符串的轮换。用stl map建立字母与位置之间的对应。 W's CipherTime limit:1sec.Submitted:48Memory limit:32MAccepted:32 Source: ACM ICPC Mid-Central USA 2001Weird Wally's Wireless Widgets, Inc. manufactures an eclectic assortment of small, wireless, network capable devices, ranging from dog collars, to pe 阅读全文
posted @ 2011-06-10 10:37 归雾 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 用两个map实现一一对应的判定。 Crypt Kicker IITime limit:1sec.Submitted:122Memory limit:32MAccepted:33 Source: Waterloo ACM Programming Contest Oct 4, 1998A common but insecure method of encrypting text is to permute the letters of the alphabet. That is, in the text, each letter of the alphabet is consistently re 阅读全文
posted @ 2011-06-09 22:29 归雾 阅读(857) 评论(0) 推荐(0) 编辑
摘要: stl set实现字符串搜索。。效率一般。(附二分搜索。) Compound WordsTime limit:1sec.Submitted:233Memory limit:32MAccepted:81 Source: Waterloo ACM Programming Contest Sep 28, 1996You are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the concatenation of 阅读全文
posted @ 2011-06-09 20:41 归雾 阅读(308) 评论(0) 推荐(0) 编辑