11858 - Frosh Week
Moderator: Board moderators
11858 - Frosh Week
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;
}
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11858 - Frosh Week
Try a different problem.
Check input and AC output for thousands of problems on uDebug!
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11858 - Frosh Week
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!
Re: 11858 - Frosh Week
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:](./images/smilies/icon_lol.gif)
I often complain over tests data, but this time this was completely my fault.
What a silly mistake
![:lol:](./images/smilies/icon_lol.gif)