比赛 |
EYOI暨SBOI暑假快乐赛3rd |
评测结果 |
AATTTTTTTTTTTTTTTTTT |
题目名称 |
Convoluted Intervals |
最终得分 |
10 |
用户昵称 |
┭┮﹏┭┮ |
运行时间 |
54.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2022-06-27 08:51:38 |
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
long long s;
int n,m;
int a[N],b[N];
int main(){
freopen("Convoluted_Intervals.in","r",stdin);
freopen("Convoluted_Intervals.out","w",stdout);
cin>>n>>m;
for(int i = 1;i <= n;i++){
cin>>a[i]>>b[i];
}
for(int i = 0;i <= 2 * m;i++){
s = 0;
for(int j = 1;j <= n;j++){
for(int k = 1;k <= n;k++){
if(a[j] + a[k] <= i && i <= b[j] + b[k]){
s++;
}
}
}
cout<<s<<endl;
}
return 0;
}