#include
#include
#include
#include
#include
using namespace std;
#define debug(x) cout#pragma warning(disable:4996)
bool help() {
int n;
cin >> n;
// 0( ,1)
vectora;
a.reserve(50);
int lcnt = 0;
for (int i = 0; i int lc;
cin >> lc;
while (lcnta.push_back(0);
++lcnt;
}
a.push_back(1);
}
stackst;
for (int i = 0; i if (a[i] == 0) {
st.push(i);
}
else if(a[i]==1) {
int tp = st.top();
st.pop();
int rc = 0;
for (int j = tp; j if (a[j] == 1) {
++rc;
}
}
cout }
}
cout
return true;
}
int main()
{
int t;
//freopen("../in1.txt","r",stdin);
cin >> t;
for (int i = 0; i help();
}
return 0;
}
服务器托管,北京服务器托管,服务器租用,机房机柜带宽租用
咨询:董先生
电话13051898268 QQ/微信93663045!
上一篇: POJ 2996 Help Me with the Game
下一篇: POJ 3253 Fence Repair【哈夫曼树】