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 1005. Stone Pile

WA #1 PLEASE HELP
Posted by mihran 18 Oct 2007 19:39
# include <iostream.h>
int main()
{
    int W[21];
    int N,a,b;
    cin>>N;
    if (N>=1 && N<=20)
    {
        for (a=0;a<=N-1;a++)
            cin>> W[a];
        for (a=0;a<=N-2;a++)
        {
            for(b=a+1;b<=N-1;b++)
            {
                if (W[a]>W[b])
                {
                    W[a]=W[b]+W[a];
                    W[b]=W[a]-W[b];
                    W[a]=W[a]-W[b];
                }
            }
        }
        cout << W[1]-W[0];
    }
    return 0;
}
Re: WA #1 PLEASE HELP
Posted by Rammstein 18 Oct 2007 20:39
I think,you're the dunkey!!!!!!!!!!!!