rt 同样的数据输入
同样的代码
不同的输出
in
50
40 41 27 24 29 20 47 42 4 17 5 33 2 19 42 48 39 8 44 44 49 24 40 41 24 27 40 34 6 37 32 30 8 27 48 38 27 6 21 24 14 10 39 37 23 11 29 7 1 17
out
386
#include <bits/stdc++.h>
using namespace std;
int n;
vector<bool> h[100005];
int NowRead,MaxH=0;
void doit()
{
int MinAns=0;
for(int i=1;i<=MaxH;i++)
{
for(int j=1;j<=n;j++)
{
if(i>h[j].size())
{
continue;
}
if(h[j-1].size()<i||!h[j-1][i])
if(h[j][i])
{
MinAns++;
}
}
}
MinAns+=n/10;
cout<<MinAns;
}
void init()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>NowRead;
MaxH=max(MaxH,NowRead);
for(int j=1;j<=NowRead;j++)
{
h[i].push_back(1);
}
}
/*
for(int i=0;i<=n;i++)
{
cout<<h[i].size()<<" ";
}
cout<<endl;
*/
//cout<<h[1][1]<<endl;
doit();
}
int main()
{
init();
return 0;
}



连续三次测试