题目地址:http://codeforces.com/contest/740/problem/C
xjb构造
#include"bits/stdc++.h"
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int ans = 2e9;
int l, r;
for(int i = 1; i <= m; i ++){
scanf("%d%d", &l, &r);
ans = min(ans, r - l + 1);
}
cout << ans << endl;
for(int i = 0; i < n; i ++){
printf("%d ", i % ans);
}
cout << endl;
return 0;
}