#include<iostream>
using
namespace
std;
int
main()
{
int
L,M;
cin>>L>>M;
int
st,en;
int
tree[10001];
int
sum=0;
for
(
int
i=0;i<=L;i++)
{
tree[i]={0};
}
for
(
int
i=0;i<M;i++)
{
cin>>st>>en;
for
(
int
j=st;j<=en;j++)
{
tree[j]={1};
}
}
for
(
int
i=0;i<=L;i++)
{
if
(tree[i]==0)
{
sum++;
}
}
cout<<sum<<endl;
return
0;
}
#include <iostream>
using
namespace
std;
int
n;
int
main()
{
int
sign[10001];
cin>>n;
for
(
int
i=1;i<=n;i++)
{
sign[i]={0};
}
for
(
int
i=2;i<=n;i++)//从二开始
{
for
(
int
j=2;j<=n;j++)
{
if
(i%j==0&&sign[i]==0)
{
sign[i]={1};
}
else
if
(i%j==0&&sign[i]==1)
{
sign[i]={0};//分号
}
}
}
for
(
int
i=1;i<=n;i++)
{
cout<<sign[i];
}
return
0;
}
#include <iostream>
using
namespace
std;
int
main()
{
int
N;
cin>>N;
int
aver,clas,num,reward=0;
char
loca,memb;
string name,m;
int
max=0,sum=0;
for
(
int
i=1;i<=N;i++)
{
cin>>name>>aver>>clas>>memb>>loca>>num;
if
(aver>80&&num>0)
{
reward+=8000;
}
if
(aver>85&&clas>80)
{
reward+=4000;
}
if
(aver>90)
{
reward+=2000;
}
if
(aver>85&&loca==
'Y'
)
{
reward+=1000;
}
if
(clas>80&&memb==
'Y'
)
{
reward+=850;
}
if
(reward>max)
{
max=reward;
m=name;
}
sum+=reward;
reward=0;//更新
}
cout<<m<<endl<<max<<endl<<sum<<endl;
return
0;
}