Page 2 of 2

Re: UVA 11858 , Frosh work

Posted: Tue Feb 05, 2013 10:45 am
by lukai
Thanks.

11858 - Frosh Week

Posted: Sun Jun 16, 2013 12:13 am
by RoniphpBB
why I am getting SubmissionErr plz help any one .......
all test cases got right answer

Code: Select all

#include <set>
#include <map>
#include <list>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string.h>
#include <vector>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;

int main()
{
    unsigned long int T,n[10000],swap=0,i,temp;
    vector<int>v;
    while(1)
    {
        cin>>T;
        if(T==0) break;
        for(i=0;i<T;i++)
        {
            cin>>n[i];
           // v.push_back(n);
        }
        for(i=0;i<T-1;i++)
        {
            for(int j=i+1;j<T;j++)
            {
                if(n[i]>n[j])
                {
                    temp=n[i];
                    n[i]=n[j];
                    n[j]=temp;
                    swap++;
                }
            }
        }
        cout<<swap<<endl;
        //v.clear();
        swap=0;
    }

    return 0;

}


Re: 11858 - Frosh Week

Posted: Mon Jun 17, 2013 11:47 pm
by brianfry713
Try a different problem.

11858 - Frosh Week

Posted: Wed Oct 09, 2013 5:31 pm
by kaangaas
AC

Re: 11858 - Frosh Week

Posted: Thu Oct 10, 2013 3:29 am
by brianfry713
Recently everyone is getting submission error on this problem. See: http://uva.onlinejudge.org/index.php?op ... 1&Itemid=1

Re: 11858 - Frosh Week

Posted: Sun Jul 05, 2015 8:08 pm
by damien_g
If you're getting WA, use long long on the answer.
I often complain over tests data, but this time this was completely my fault.

What a silly mistake :lol: