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 1100. Final Standings

Arrays called M[]
Posted by Nickolay Todorov 9 Mar 2002 18:10
I highly recommend you not to use arrays called M[]. That's very
wrong. I wanted to use it, so I get WA. I do not know how I get to
the idea, but I changed to Y[] and it worked. ACC.
Wish you luck
This code written in C++ does not work:
#include <stdio.h>
int X[150000];
char M[150000];
int N;

int main () {
    int i, j;

    scanf ("%d", &N);

    for (i=0; i<N; ++i)
        scanf ("%d%d", &X[i], &M[i]);

    for (j=100; j>=0; --j)
        for (i=0; i<N; ++i)
            if ( M[i]==j)
                printf ("%d %d\n", X[i], M[i]);
    return 0;
}
OH MY GOD! IT IS TRUE!!!!!!! IT REALLY GETS WA WITH ARRAY M[] AND GET ACCEPTED WITH ARRAY Y[] INSTEAD. WITH ARRAYS A[] OR C[] IT GETS WA TOO. WHAT IS THIS VERY STRANGE BUG????????? PEOPLES CHECK THIS
Posted by Andrey Popyk (popyk@ief.tup.km.ua) 11 Mar 2002 13:28
> I highly recommend you not to use arrays called M[]. That's very
> wrong. I wanted to use it, so I get WA. I do not know how I get to
> the idea, but I changed to Y[] and it worked. ACC.
> Wish you luck
> This code written in C++ does not work:
> #include <stdio.h>
> int X[150000];
> char M[150000];
> int N;
>
> int main () {
>     int i, j;
>
>     scanf ("%d", &N);
>
>     for (i=0; i<N; ++i)
>         scanf ("%d%d", &X[i], &M[i]);
>
>     for (j=100; j>=0; --j)
>         for (i=0; i<N; ++i)
>             if ( M[i]==j)
>                 printf ("%d %d\n", X[i], M[i]);
>     return 0;
> }
Re: Arrays called M[]
Posted by liufeng 23 Jan 2003 18:22
a joke
this program should run in C language
i submit it in C++ language ,but got WA
then in C language ,it's ACC




> I highly recommend you not to use arrays called M[]. That's very
> wrong. I wanted to use it, so I get WA. I do not know how I get to
> the idea, but I changed to Y[] and it worked. ACC.
> Wish you luck
> This code written in C++ does not work:
> #include <stdio.h>
> int X[150000];
> char M[150000];
> int N;
>
> int main () {
>     int i, j;
>
>     scanf ("%d", &N);
>
>     for (i=0; i<N; ++i)
>         scanf ("%d%d", &X[i], &M[i]);
>
>     for (j=100; j>=0; --j)
>         for (i=0; i<N; ++i)
>             if ( M[i]==j)
>                 printf ("%d %d\n", X[i], M[i]);
>     return 0;
> }