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 1100. Final Standings

why WA 1
Posted by WOVVAN 27 Sep 2010 22:36
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

  int n;
  pair<int, int> a[1000001];

int main()
{
    cin >> n;
    for (int i = 0;i < n; i++)
        scanf("%d %d", &a[i].second, &a[i].first);
    sort(a, a + n);
    for (int i = n - 1; i >= 0; i--)
        printf("%d %d\n", a[i].second, a[i].first);
    return 0;
}
Re: why WA 1
Posted by hatred 11 Aug 2011 15:07
because quick sort gives an other order for the equal numbers than bubble sort