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

Let's create new memes for 2010

Name: Anonymous 2010-05-06 9:30

I'll start:

/prog/ is really slow today, now I have two problems.

Name: Anonymous 2010-05-07 10:40

>>40
Some people, when confronted with a post, think
“I know, I'll use BBCode.” Now they have two problems.

Name: Anonymous 2010-05-07 14:00

>>39
YHABT. TINBT here in /Prague/.
Every troll is a troll troll.

IHBT

Name: Anonymous 2010-05-07 15:59

bring back suave yoshi

Name: Anonymous 2010-05-07 16:32

Any ideas on how I could make this program run faster?
It's supposed to run under 0.5 seconds.
In some cases it does, in others it fails.
[b]The task : [/b]

INPUT:
From the first line of the standard input read one integer (5 <= n <= 100000). Each of the following n lines will have one of the following two formats:

- 1 a - meaning that Mirko said aloud the number a, (0 <= a <= 65535).
- 2 k - meaning that Mirko asks what is the kth smallest number he has said so far. k will always be less or equal to the number of numbers Mirko has said aloud so far.

The total number of different number will not be bigger than 400, but some of the numbers can repeat!

OUTPUT:
To the standard output write one line for each of the 2 k inputs. Representing the kth smallest number at that moment.


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-05-07 16:32

Have u read your SICP today? ;)

Name: Anonymous 2010-05-09 0:08

Some people, when confronted with nothing to say, think
“I know, I'll ask if you've read SICP today.”   Now they have two problems.

Name: Anonymous 2010-05-09 0:29

Abelson Stole The Precious Course

Name: Anonymous 2010-05-09 0:36

>>47
I'm eagerly awaiting new versions of that.

Name: Anonymous 2010-05-09 0:46

People are wondering how they can better fit in with the /prog/ crowd. They say ``Oh, I'll just start a thread about creating memes!'' Now they have two problems.

Name: Anonymous 2010-05-09 1:30

>>49
You're not very good at this.

Name: Anonymous 2010-05-09 3:29

>>50
Neither are you. And your shoes are united. You're a mess. Clean yourself up.

Name: Anonymous 2010-05-09 3:30

>>50
Now he has a problem.

Name: Anonymous 2010-05-09 3:32

>>51
Now he has three problems.

Am I doing this right?

Name: Anonymous 2010-05-09 6:33

>>53
Your house is one fire. Now you have at least one problem/

Name: Anonymous 2010-05-09 7:21

>>51
Shoes, UNITE!

Name: Anonymous 2010-05-09 16:35

HAXUS THE GREAT 2100

Name: Anonymous 2010-05-09 19:20

>>55
I took that to mean that the soles had melted together, which would indeed be a problem.  Now you have one shoe.

Name: Anonymous 2010-05-09 22:14

Name: Anonymous 2010-05-10 4:46

>>58
I LOVE YOU! I LOVE YOUR POST! I WATCHED IT FIVE TIMES! KEEP POSTING!

Name: Anonymous 2010-05-10 5:11

>>58
wat

Name: Anonymous 2010-05-10 5:46

>>58
This is wonderful and also wonderful.

Name: Anonymous 2010-05-10 5:52

Name: Anonymous 2010-05-10 7:34

>>62
How is /jp/ these days? I haven't been on in so long.

Name: Anonymous 2010-05-10 9:31

>>63
Still shit.

Name: Anonymous 2010-05-10 10:17

>>64
Well obviously, but has it gotten shitter?

Name: Anonymous 2010-05-10 11:16

>>62
I shall award you with a shiny POST OF THE WEEEK medal!

Name: Anonymous 2010-05-10 11:55

>>65
Better and worse.

Name: Anonymous 2010-05-10 12:38

>>67
It exists in a state of quantum supershittiness?

Name: Anonymous 2010-05-10 12:48

>>68
Actually, I think he was hinting at  entanglement with /prog/

Name: Anonymous 2010-05-10 13:55

>>69
HIT MY ANUS

Name: Anonymous 2010-05-10 14:06

The /prog/ centipede.

Name: Anonymous 2010-05-10 14:13

dick hole

Name: Anonymous 2010-05-10 14:57

Name: Anonymous 2010-05-10 16:41

Reencoded audio is reencoded.

Name: Anonymous 2010-05-10 16:44

http://rapidshare.com
Come on, I thought you guys were better than this.

Name: Anonymous 2010-05-10 16:55

>>74
Uses samples and instruments from Reason. Nothing can save it.

Name: Anonymous 2010-05-10 18:37

>>74
Redundant statement is a redundant statement.

Name: Anonymous 2010-05-10 22:10

>>60
wat
* What?

Name: Anonymous 2010-05-11 3:26

*grabs vagina*

Name: Anonymous 2010-05-11 4:37


dicks and chicks

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