Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

给点数据,还有G++错误的问题

Posted by 15067190130 at 2014-07-20 09:59:33 on Problem 3608
1.G++,输出double类型的时候,需要用%f(好像只有POJ是这样的吧?)。
2.排序长度注意了没,我自己都用一个长度排序,造数据的时候也是n==m,汗死


数据代码来自zdg102 ,方便起见我就直接贴了,勿怪。
数据生成代码:
#include <stdio.h>
struct point{double x,y;};
struct polygon
{
    int n;
    point data[10];
};
#define N   16
polygon p[N]={
    {4,{{0,0},{-1,0},{-1,-1},{0,-1}}},
    {4,{{2,0},{2,-1},{3,-1},{3,0}}},
    {4,{{247,208},{247,235},{375,235},{375,208}}},
    {3,{{85 ,101},{116 ,168},{168 ,103}}},
    {3,{{131 ,189},{216 ,148},{196 ,209}}},
    {3,{{180 ,127},{246 ,127},{202 ,144}}},
    {3,{{226 ,201},{297 ,201},{242 ,151}}},
    {3,{{42 ,225},{61 ,261},{100,222}}},
    {3,{{84 ,261},{99 ,246},{102,260}}},
    {3,{{72,309},{157,224},{167,309}}},
    {3,{{170,221},{229,221},{199,245}}},
    {3,{{190,90},{153,47},{225,108}}},
    {3,{{165,230},{168,242},{172,233}}},
    {6,{{143,146},{133,156},{138,170},{150,173},{161,166},{161,152}}},
    {5,{{109,208},{100,236},{111,253},{122,250},{161,206}}},
    {6,{{177,273},{174,309},{202,377},{417,375},{490,270},{268,239}}}
    };
int main()
{
    freopen("C:\\Documents and Settings\\Administrator\\桌面\\out.txt","w",stdout);
    int i,j,k,num=0;
    for(i=0;i<N;i++)
    {
        for(j=0;j<N;j++)
        {
            if(i==j)
                continue;
            num++;
            //if(num>35||num<=33)continue;
            printf("%d %d\n",p[i].n,p[j].n);
            for(k=0;k<p[i].n;k++)
                printf("%lf %lf\n",p[i].data[k].x,p[i].data[k].y);
            for(k=0;k<p[j].n;k++)
                printf("%lf %lf\n",p[j].data[k].x,p[j].data[k].y);
            printf("\n\n");
        }
    }
    printf("0 0\n");
    return 0;
}

数据答案:
2.00000 322.91330 132.00758 229.96087 220.29299 285.24551 228.88643 265.17353 273.54159 278.82073 160.05624 283.06360 204.36487 234.82973 325.35826 2.00000 320.62439 130.09612 228.26520 217.84857 282.70479 228.35499 264.06817 271.83083 277.00181 157.19097 281.32543 202.27704 233.45235 323.73600 322.91330 320.62439 127.28162 48.15016 75.91705 7.00000 147.00000 147.13939 88.09830 18.00000 102.39141 75.00000 95.70789 86.02325 4.00000 132.00758 130.09612 127.28162 25.80698 24.36311 88.20431 56.32051 79.83107 69.40461 75.66373 25.15538 79.02531 5.77843 39.70142 121.43311 229.96087 228.26520 48.15016 25.80698 8.77678 25.67736 45.27693 65.36819 25.80603 12.00000 41.00000 29.18802 6.15651 7.42567 53.30219 220.29299 217.84857 75.91705 24.36311 8.77678 20.94556 124.19742 143.69016 91.78780 77.00000 19.00000 93.62149 31.39963 74.33034 112.09107 285.24551 282.70479 7.00000 88.20431 25.67736 20.94556 127.73801 134.73678 72.73239 20.00000 46.23851 62.76942 72.57472 65.19202 38.00000 228.88643 228.35499 147.00000 56.32051 45.27693 124.19742 127.73801 16.26346 41.71930 70.00714 159.76232 65.49046 64.40497 4.28413 92.35800 265.17353 264.06817 147.13939 79.83107 65.36819 143.69016 134.73678 16.26346 13.43503 75.27284 180.60177 67.91171 85.42248 6.27208 76.11833 273.54159 271.83083 88.09830 69.40461 25.80603 91.78780 72.73239 41.71930 13.43503 13.34166 134.25705 7.24416 51.47815 6.36396 7.00000 278.82073 277.00181 18.00000 75.66373 12.00000 77.00000 20.00000 70.00714 75.27284 13.34166 113.00000 7.96960 52.00000 16.68474 18.52915 160.05624 157.19097 102.39141 25.15538 41.00000 19.00000 46.23851 159.76232 180.60177 134.25705 113.00000 135.77085 68.39894 116.42048 137.87676 283.06360 281.32543 75.00000 79.02531 29.18802 93.62149 62.76942 65.49046 67.91171 7.24416 7.96960 135.77085 58.94065 18.91277 32.18925 204.36487 202.27704 95.70789 5.77843 6.15651 31.39963 72.57472 64.40497 85.42248 51.47815 52.00000 68.39894 58.94065 33.39838 103.12502 234.82973 233.45235 86.02325 39.70142 7.42567 74.33034 65.19202 4.28413 6.27208 6.36396 16.68474 116.42048 18.91277 33.39838 56.41515 325.35826 323.73600 4.00000 121.43311 53.30219 112.09107 38.00000 92.35800 76.11833 7.00000 18.52915 137.87676 32.18925 103.12502 56.41515 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator