您当前的位置: 首页 > 

钟钟终

暂无认证

  • 2浏览

    0关注

    233博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

第二周--贪心题解(J)

钟钟终 发布时间:2021-03-15 13:07:42 ,浏览量:2

题J: Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after the deadline, the teacher will reduce his score of the final test. And now we assume that doing everyone homework always takes one day. So Ignatius wants you to help him to arrange the order of doing homework to minimize the reduced score. Input The input contains several test cases. The first line of the input is a single integer T that is the number of test cases. T test cases follow. Each test case start with a positive integer N(1>t; while(t--) { memset(a,0,sizeof(a)); memset(c,0,sizeof(c)); int n; cin>>n; for(int i=0;i>a[i].x; } for(int i=0;i>a[i].y; } sort(a,a+n,cmp); int sum=0; for(int i=0;i=1&&c[j]!=0) j--; if(j

关注
打赏
1664378814
查看更多评论
立即登录/注册

微信扫码登录

0.0433s