Codeforces Round #208 (Div. 2) B. Dima and Text Messages
B. Dima and Text Messages
思路很简单,字符串匹配,顺序扫一遍,o(n)的算法,居然TLE~~~~
原因居然是strlen!!!!
难道执行100000 strlen也算超时!!!! 受教了!!!
TLE代码如下:
for(int i=0;i<n;i++){scanf("%s",word);for(int j=0;word[j];j++)words[len++]=word[j];words[len++]='<';words[len++]='3';}看来,以后用库函数,要慎重!!!