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

What about my new code?

Name: Anonymous 2010-03-02 5:40

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: Anonymous 2010-03-04 18:01

WHAT ABOUT MY ANUS

Name: Anonymous 2010-03-04 18:04

>>1
Not only did you miss you're original thread, but you wound up on entirely the wrong board.  You are a complete failure.

Name: Anonymous 2010-03-04 19:12

>>3
miss you're original thread
complete failure
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: Anonymous 2010-03-05 3:11

[/code]

Name: Anonymous 2010-03-05 12:07

One look at my code and you'll disappear forever!

Name: Anonymous 2010-03-05 12:11

CODE MY ANUS

Name: RedCream 2010-03-05 12:22

KODZHAXXORZ!

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