1.  C, Evgeni Pavlidis

/**
 * ACM programming Contest WS 08/09
 * UVa Status:  accepted
 * Run Time:    0.???
 * @author Evgeni Pavlidis evgenipavlidis@yahoo.de
 */
#include <stdio.h>

#define MAX 2000

int a[MAX];

int main()
{
    int n = 1500;
       
    a[0] = 1;
    int t = 1;
    int n2 = 2;
    int n3 = 3;
    int n5 = 5;
    int i = 0;
    int j = 0;
    int k=0;

    int p = 0;

    while(p < n-1)
    {
        if(n2 <= n3)
        {
            if(n2 <= n5)
                t = n2;
            else
                t = n5;
        }
        else
        {
            if(n3 < n5)
                t = n3;
            else
                t  = n5;

        }

        a[++p] = t;
        if(n2 == t) n2 = 2*a[++i];
        if(n3 == t) n3 = 3*a[++j];
        if(n5 == t) n5 = 5*a[++k];
    }

    printf("The 1500'th ugly number is %d.\n", a[n-1]);
    return 0;
}


2.  C, Evgeni Pavlidis

#include <stdio.h>

int main()
{
    printf("The 1500'th ugly number is 859963392.\n");
    return 0;
}

3.  Java, Gunnar Hage

/**
* FWP-Fach: ACM programming Contest WS 08/09 "136 - Ugly Numbers // 136 - Ugly Numbers"
* Verdict: accepted / 0.100
*
* Gunnar Hage, gunnarhage@gmx.de
* AP5(IFB5A) Okt. 2008
*/

public class Main {
public static void main(String[] args) {
int n = 1500;
int[] a = new int[n];
int t,p,n2,n3,n5,i,j,k;
a[0]=1; t=1; p=0;
n2=2; i=0;
n3=3; j=0;
n5=5; k=0;
while(p<n-1){
t = Math.min(Math.min(n2, n3), Math.min(n5, Integer.MAX_VALUE));
a[++p] = t;
if(n2 == t) n2=2*a[++i];
if(n3 == t) n3=3*a[++j];
if(n5 == t) n5=5*a[++k];
}
System.out.println("The 1500'th ugly number is " + a[1499] + ".");
System.exit(0);
}
}