Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

how about my code

Name: Anonymous 2010-03-04 19:11

Input:
7
1 0
1 1
1 5
2 1
2 3
1 2
2 3

Output:
0
5
2

My solution :

#include <stdio.h>
int main(){
    unsigned short int * a;
        unsigned int n,j,x,y;
    int m=-1;
    scanf("%u",&n);
    a=new unsigned short int[n];
    while (n>0){
        n=n-1;
        scanf("%u %u",&x,&y);
        if (x==1){
            m=m+1;
            j=m;
            a[j]=y;
            while((j>0)&&(a[j]<a[j-1])){
                y=a[j-1];
                a[j-1]=a[j];
                a[j]=y;
                j=j-1;
            }

        }
        else printf("%u\n",a[y-1]);
    }
    delete [] a;
    return 0;
}

Name: RedCream 2010-03-04 19:46

Before moot can review this codebase, he requires a BLOWS JOB from you.

Name: Anonymous 2010-03-05 9:18

>>2
I see. What is "Blow's Job'' ? A carpenter I hope.

Name: Anonymous 2010-03-05 9:54

Why is the text different suddenly?

Name: Anonymous 2010-03-05 9:59

Secret, secret! I've got a secret!

Name: Anonymous 2010-03-05 10:15

>>5
What is it!

Name: RedCream 2010-03-05 11:17

>>3
You know, a BLOWS JOB ... an oral stimulation of the penor.

Name: Anonymous 2010-03-05 12:05

>>7
Haw haw, you said penor!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List