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 1313. Some Words about Sport

Why "Crash (access violation)" ? totally misunderstood
Posted by Dastan Yelubayev 29 Oct 2012 03:25
Hello all.
I have some problem with this task?
Why crash:acces violation?
Here is the code
-------------------------------------------------
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;

int main ()
{
int n,i,j;
int a[100];
cin>>n;
for( i=0;i<n*n;i++)

cin>>a[i];

sort(a,a+n*n);

for( i=0;i<n*n;i++)
cout<<a[i]<<" ";

return 0;
}


I didn't use two dimensional arrays cause I'had tried to find the laziest way. Could u help ?
Local test on computer is pretty good, u can check by trying code by yourselves;
Re: Why "Crash (access violation)" ? totally misunderstood
Posted by NuVeS 16 Mar 2013 11:22
The problem is not to sort array. Check it again!!!