怎么变长了?高手进来.....

program xiaomenwaideshu;

var a,b,i,j,d,t:integer;

spot: array[1..10000] of integer;

spo: array[1..10000] of integer;

begin

read(a,b);

a:=a+1;

for i:=1 to b do

begin

readln(spot[i],spo[i]);

t:=abs(spot[i]-spo[i])+1;

a:=a-t;

end;

for i:=2 to b do

for j:=1 to b-1 do

if (spo[i]>spot[j]) and (spo[i]< spo[j]) then

begin

d:=abs(spot[j]-spo[i])+1;

a:=a+d;

end;

writeln(trunc(a));

end.

2 条评论

  • @ 2016-08-19 13:42:17

    什么东西变长……

  • @ 2016-08-19 13:42:02
    #include<iostream>
    using namespace std;
    int x[10010]={0},l,m;
    long total=0;
    int main()
    {
      cin>>l>>m;
      for(int i=0;i<=l;i++)
        x[i]=1;
      int a,b;
      for(int i=0;i<=m;i++)
      {
        cin>>a>>b;
        for(int j=a;j<=b;j++)
          x[j]=0;
      }
      for(int i=0;i<=l;i++)
        total+=x[i];
      cout<<total;
      return 0;
    }
    

    你讲的变长……是……什么鬼……

  • 1

信息

ID
1103
难度
4
分类
模拟 点击显示
标签
递交数
14290
已通过
6515
通过率
46%
被复制
50
上传者