1 #include<iostream>
 2 #include<stdio.h>
 3 using namespace std;
 4 
 5 int main()
 6 {
 7     //freopen("acm.acm","r",stdin);
 8     int tree;
 9     int num;
10     int sum;
11     int a,b;
12     while(1)
13     {
14     cin>>tree;
15     cin>>num;
16     if(!tree && !num)
17         break;
18     ++ tree;
19     sum = 0;
20     while(num --)
21     {
22         cin>>a;
23         cin>>b;
24         sum += b - a + 1;
25     }
26     cout<<tree - sum<<endl;
27     }
28 }

 

相关文章:

  • 2021-09-13
  • 2022-02-13
  • 2021-10-17
  • 2022-01-02
  • 2021-08-23
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
猜你喜欢
  • 2022-02-01
  • 2021-08-31
  • 2021-12-04
  • 2021-06-18
  • 2021-12-17
  • 2022-12-23
相关资源
相似解决方案