10941 wrong input data

The forum to report every bug you find or tell us what you'd like to find in UVa OJ's new system

Moderator: Board moderators

Post Reply
milmar
New poster
Posts: 5
Joined: Fri Jun 12, 2009 4:52 pm

10941 wrong input data

Post by milmar »

I solved problem 10941, but the data are faulty. In the task one can read that all words have at most 1000 characters, which is not true in case of the word x. the following code give run-time error (while it should not):

Code: Select all

int main(int argc, char *argv[]) {
    int T, K;
    scanf("%d", &T);
    for (int t = 1; t <= T; t++) {
        scanf("%s%s%d", data[0], data[1], &K);        
        if (strlen(data[0]) > 1000) return -1;

Post Reply

Return to “Bugs and suggestions”