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

Common Board

Please help Time limit problem=1100
Posted by (TUIT 420-14) Rakhmatov Izzat 26 Sep 2014 23:33
import java.util.Scanner;
public class Acm {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        for(int j = 0; j < n; j++){
                Scanner u = new Scanner(System.in);
                   a[j] = s.nextInt();
            b[j] = s.nextInt();
        }

        for(int p = 100; p >= 0; p--){
            for(int q = 0; q < n; q++){
                if(b[q] == p){
                    System.out.println(a[q] + " " + b[q]);
                }
            }
        }
    }
}

Edited by author 26.09.2014 23:34