All pastes #59138 Raw Edit

ghostbusters

public c v1 · immutable
#59138 ·published 2006-05-26 23:24 UTC
rendered paste body
#include <stdio.h>void connect();struct point{    int x;    int y;    int numer;    int kto;    int zajety;} PUNKTY[200000];int main(){    int n, i, numer=1;    int smallest=0;    struct point *elementy[200000];    scanf("%d\n", &n);    for(i=0; i<n; i++)    {        scanf("%d %d\n", &PUNKTY[i].x, &PUNKTY[i].y); /*pogromcy duchow*/        PUNKTY[i].numer=numer++;        PUNKTY[i].kto=1;        elementy[i]=&PUNKTY[i];        if(elementy[i]->y < elementy[smallest]->y)        {            smallest=i;        }        else if(elementy[i]->y == elementy[smallest]->y && elementy[i]->x < elementy[smallest]->x)        {            smallest=i;        }    }    n*=2;    numer=1;    for(; i<n; i++)    {        scanf("%d %d\n", &PUNKTY[i].x, &PUNKTY[i].y); /*duchy*/        PUNKTY[i].numer=numer++;        PUNKTY[i].kto=0;        elementy[i]=&PUNKTY[i];        if(elementy[i]->y < elementy[smallest]->y)        {            smallest=i;        }        else if(elementy[i]->y == elementy[smallest]->y && elementy[i]->x < elementy[smallest]->x)        {            smallest=i;        }    }    /*najmniejszy el. jako pierwszy*/    for(i=0; i<n; i++)    {        printf("%d %d %d %d", PUNKTY[i].x, PUNKTY[i].y, PUNKTY[i].numer, PUNKTY[i].zajety);        if(PUNKTY[i].kto==1) printf(" pogromca\n");        else printf(" duch\n");    }    for(i=0; i<n; i++)    {        printf("%d %d\n", elementy[i]->x, elementy[i]->y);    }    printf("najmniejszy %d", smallest);    return 0;}void connect(){}