Saturday, 25 January 2014

UVa Problem ID 11462 (Age Sort)

//Note :-another approach use counting sort

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) throws IOException 
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuffer sb=new StringBuffer("");
        while(true)
    	{
	    	int n=Integer.parseInt(br.readLine());
	    	if(n<=0 || n>2000000)
	        	break;
	        String s[]=br.readLine().split(" ");
	        int ages[]=new int[n];
	        for (int i = 0; i 
Previous Post
Next Post

0 comments:

Advertisement