您的位置:首页 > 理论基础 > 计算机网络

2017年西南民族大学程序设计竞赛-网络同步赛(代码)

2017-12-30 21:57 399 查看
20598954    nmphy    D    答案正确    8    512    486    C++    2017-12-30 14:30:35
20598712    nmphy    E    答案正确    3    504    695    C++    2017-12-30 14:25:59
20598181    nmphy    E    答案正确    3    484    659    C++    2017-12-30 14:15:16
20597638    nmphy    E    答案正确    3    504    505    C++    2017-12-30 14:05:08//比赛时候这里显示的是WA,而且显示准确率5%
20597208    nmphy    F    答案正确    3    272    569    C++    2017-12-30 13:57:09
20596793    nmphy    H    答案正确    3    384    312    C++    2017-12-30 13:49:00
20596485    nmphy    J    答案正确    15    512    493    C++    2017-12-30 13:43:23
20596125    nmphy    G    答案正确    4    396    768    C++    2017-12-30 13:36:12
20596077    nmphy    G    答案正确    3    384    768    C++    2017-12-30 13:35:22
20595884    nmphy    G    答案错误    4    384    840    C++    2017-12-30 13:31:43
20595709    nmphy    G    答案错误    4    384    825    C++    2017-12-30 13:28:29
20595099    nmphy    I    答案正确    4    384    386    C++    2017-12-30 13:16:36
20594924    nmphy    K    答案正确    4    436    555    C++    2017-12-30 13:13:09
20594652    nmphy    D    段错误    3    384    485    C++    2017-12-30 13:07:57
20594225    nmphy    C    答案正确    71    3904    560    C++    2017-12-30 12:59:14
20594201    nmphy    C    答案正确    69    4028    560    C++    2017-12-30 12:58:48
20593760    nmphy    B    答案正确    3    512    553    C++    2017-12-30 12:49:38
20593541    nmphy    A    答案正确    516    13056    988    C++    2017-12-30 12:44:16


反正就是12.30左右知道他们有比赛,赶紧注册的。。14.30AK,(其中还有E题耽误的不少时间)排名第7。。。可见其题难道。。。难道我是难题渣。。。水题王。。。打表。。。贪心。。。

E题比赛时错了很多次,后来刷新后就A了。。。可能数据有点极端。(耽误了我20分钟。比完才告诉我A了,我以为10题挂机,结果AK了)。

A:

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<string>
#define ll long long
using namespace std;
const int maxn=10010;
ll sum[maxn],Max;
int main()
{
int n,m,i,j,L,R;
while(~scanf("%d%d",&n,&m)){
Max=0;for(i=1;i<=5000;i++) sum[i]=0;
for(i=1;i<=n;i++) {
scanf("%d%d",&L,&R);
sum[L]++;
sum[R+1]--;
}
for(i=1;i<=5000;i++) {
sum[i]+=sum[i-1];
if(sum[i]>Max) Max=sum[i];
}
if(Max%m==0) printf("%lld\n",Max/m);
else printf("%lld\n",Max/m+1);
} return 0;
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐