you do a lot of strlen() that spent a lot of time.
try to calcule the length at the start and save it in a var.
Search found 2 matches
- Mon Jan 13, 2003 1:15 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10340 - All in All
- Replies: 129
- Views: 46149
- Sat Jan 11, 2003 12:21 am
- Forum: Volume 103 (10300-10399)
- Topic: 10340 - All in All
- Replies: 129
- Views: 46149
10340
I don't know why always get WA. I can't find any mistake in the code. I hope somebody could find it. thanks #include <stdio.h> #define SIZE 1000000 int main() { char cad1[SIZE], cad2[SIZE]; int x,y; while ( scanf("%s %s",cad1,cad2) == 2 ) { for (x = 0, y = 0; cad1[x] != '\0' && cad...