CSU_Liutong_2202 @ 2024-02-13 11:01:11
#include<stdio.h>
int main() {
int l, m, i;
scanf("%d %d", &l, &m);
int flag[10000] = {};
int u, v, j;
for (i = 1; i <= m; i++) {
scanf("%d %d", &u, &v);
for (j = u; j <=v; j++) {
flag[j] = 1;
}
}
int n = 0;
for (i = 0; i < l; i++) {
if (flag[i] == 0) {
n++;
}
}
printf("%d", n);
return 0;
}
by jeffstart @ 2024-02-13 11:06:15
@CSU_Liutong_2202 应该是
by CSU_Liutong_2202 @ 2024-02-13 11:31:02
@jeffstart 谢谢。