11858 - Frosh Week

All about problems in Volume 118. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

lukai
New poster
Posts: 25
Joined: Wed Dec 05, 2012 8:11 pm

Re: UVA 11858 , Frosh work

Post by lukai » Tue Feb 05, 2013 10:45 am

Thanks.

RoniphpBB
New poster
Posts: 10
Joined: Sat Feb 09, 2013 11:22 am

11858 - Frosh Week

Post by RoniphpBB » Sun Jun 16, 2013 12:13 am

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;

}


brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11858 - Frosh Week

Post by brianfry713 » Mon Jun 17, 2013 11:47 pm

Try a different problem.
Check input and AC output for thousands of problems on uDebug!

kaangaas
New poster
Posts: 1
Joined: Wed Oct 09, 2013 5:26 pm

11858 - Frosh Week

Post by kaangaas » Wed Oct 09, 2013 5:31 pm

AC
Last edited by kaangaas on Thu Oct 10, 2013 1:03 pm, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11858 - Frosh Week

Post by brianfry713 » Thu Oct 10, 2013 3:29 am

Recently everyone is getting submission error on this problem. See: http://uva.onlinejudge.org/index.php?op ... 1&Itemid=1
Check input and AC output for thousands of problems on uDebug!

damien_g
New poster
Posts: 8
Joined: Sun Oct 05, 2014 5:53 pm

Re: 11858 - Frosh Week

Post by damien_g » Sun Jul 05, 2015 8:08 pm

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:

Post Reply

Return to “Volume 118 (11800-11899)”