hdu 1075 What Are You Talking About(Trie树) 水平太弱了,这道题里面学到很多 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1075 //巩固了字符串中'\0'的使用,strlen只求\0前面的串的长度,cout只输出\0前面的串,所以利用\0本质上可以实现字符串的清空操作#include<iostream>#include<cstring>usin...
HDU 1075 What Are You Talking About(Tire树) 题目链接 写的太渣了,依旧RE了几次。。。 1#include <stdio.h>2#include <string.h>3#include <stdlib.h>4charstr[500001][101];5charword[500001];6charch[5001];7structnode8{9intflag;10structnode *next[26];11};12intnum =1;13structnode *buil...
with a single string "END" indicates the end of the book part, and that's also the end of the input. All the words are in the lowercase, and each word will contain at most 10 characters, and each line will contain at most 3000 characters. Output In this problem, you have to output...
map<string,string>::iterator it;chara[3010],b[3010];strings;intmain() { scanf("%s",a);while(1) { scanf("%s",a);if(strcmp(a,"END")==0)break; scanf("%s",b); m[b]=a; } scanf("%s",a);getchar();while(1) { getline(cin,s);if(s.compare("END")==0)break;intlen=s....
Sujay Mehdudia wrote: "Income-Tax officials have alleged that these companies evade taxes with impunity as the tax laws of the country are 'inadequate and ineffective' to deal with such cases." He wrote of multinational giants flouting tax laws knowing very well that they could not...
hdu 1075 What Are You Talking About(字典树) 刚学的字典树,代码写得很不熟练。写法上也没有什么特别的优化,就是以1A为第一目标! 可惜还是失败了。 少考虑了一种情况,就是一个单词是另一个单词前缀的问题,写了好久,还是没有1A。不过感觉对字典树有了更深刻的理解。 代码写得不好,看看别人都是怎么写...
2015-08-22 16:18 −题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1075 What Are You Talking About Time Limit: 10000/5000 MS (Java/Others) Memory Li... 若忆_star 0 1598 题解报告:hdu 1075 What Are You Talking About 2018-03-26 21:58 −题目链接:http://acm.hdu.edu.cn/sh...
1.cin不读取空格 2.此题要划分单词,与其他要划分字符串的题目类似,此题可以先遍历一遍字符串数组,对于每个满足要求的字符,再遍历一遍后面的数据来划分单词 3.char 数组可以作为map<string,string>的索引 4.最后结果可以不用储存,可以直接输出 #include <iostream> ...
HDU-1075-What Are You Talking About http://acm.hdu.edu.cn/showproblem.php?pid=1075 字典树 #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> using namespace std; struct node { int count; node *childs[26]; char tran[15]; node() { count=0; for(int i=0;i<26...
简介:HDOJ/HDU 1075 What Are You Talking About(字符串查找翻译~Map) Problem Description Ignatius is so lucky that he met a Martian yesterday. But he didn’t know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius want...