Now appear in the HansBug konjac is in front of an English composition, IQ worry HansBug has scribbled out, however, when he found that there are 404040 minutes away from the exam was over, so he's going to estimate the total of the value of MMM is a word of English composition, is known to all, use the advanced vocabulary in the entrance examination for secondary school or college English composition can effectively improve the gold content of the article, to get a better score, known konjac HansBug know NNN advanced vocabulary, the vocabulary for AiA_iAi? (word length for LiL_iLi? , contain Numbers, letters), the value of the advanced vocabulary for BiB_iBi? , the advanced vocabulary comes once every can increase BiB_iBi? Gold content, but his brain cells and the RP has run out, so this great task to you! Input format
NNN and the PPP, the first line contains two integers NNN said HansBug total number of advanced vocabulary know the PPP for module
2? 12 - N + N + 12? N + 1 lines, each line contains a word AiA_iAi? Length (Li) and an integer BiB_iBi? , of which the Bi (0 & lt; Bi 105) or less B_i (0 & lt; B_i \ Bi le 10 ^ 5)? (0 & lt; Bi? The value of 105 or less), said the word
Until the end of the input of the next several behavior an English composition, containing a total of MMM a word, and a number of separators (separator contains and only contains,,,! ,?) The output format
A line contains an integer, for the total value of the article to the PPP mode, Input and output sample Enter the # 1
5 99 Hansbug 1 Kkksc03 2 Yyy 3 Absi2011 4 LZN 100 Hansbug is a juruo! But absi2011 not.! ? ! One day absi2011 laughed at yyy and hansbug. Then kkksc03 and LZN blamed question for that.
Output # 1
16
Enter the # 2
5 99 Yyyy 1 Kkksc03 2 Yyy 3 Absi2011 4 LZN 100 Yyyy is a juruo! But absi2011 not.! ? ! One day absi2011 laughed at yyy and yyyy. Then kkksc03 and LZN blamed question for that.
Output # 2
16
My code:
# include & lt; Iostream>
# include & lt; Map>
using namespace std;
Map a;
Int main () { Int n, p, I, co=0; String st, s; Cin> N> p; for(i=0; i { Cin> St. Cin> A [st]; } While (cin> St) { If (st. find (', ')==1 & amp; & St. find (')==1 & amp; & St. find ('? ')==1 & amp; & St. find ('! ')==1) { If (a.f ind (st)! Co +=a.e nd ())=a (st); } The else { for(i=0; i { If (st [I]!=', '& amp; & St [I]!='& amp; & St [I]!='? '& amp; & St [I]!='! ') { S +=st [I]; } The else { If (a.f ind (s)! Co +=a=a.e nd ()) [s]. S=""; } } } } Coutreturn 0; }
Bosses, please help to see where there is a problem, thank you very much Note: which beginner c + + as I do, and we can talk direct messages
CodePudding user response:
Huh? Don't answer other people's posts to see other people's answer now?