ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1419. Maps of the Island Worlds

Show all messages Hide all messages

there is some bugs in tests Alias aka Alexander Prudaev 25 Aug 2007 16:49
in test 11 one or more line has length less then w symbols!
please fix it!
gets(s[0]);
    char *p = strtok(s[0], " ");
    int w = atoi(p);
    p = strtok(0, " ");
    int h = atoi(p);
    if (!(h&1) || !(w&1)) WA();
    for (int i = 0; i < h; i++)
    {
        gets(s[i]);
        if (strlen(s[i]) < w) (*(int*)0)++;
    }
Re: there is some bugs in tests Razdolbay from SIS 26 Aug 2007 14:37
Maybe you mean

p = strtok(s[0], " ");

instead of

p = strtok(0, " ");

?
Re: there is some bugs in tests Alias aka Alexander Prudaev 12 Sep 2007 22:39
no, i mean strtok(0, " ")
in case of zero (null) strtok gets last pointer plus position
of  token