#include <iostream>
#include <bits/stdc++.h>
#include <string> using namespace std; typedef struct
{
int end;
bool isDrop;
}Tree; vector<Tree> tree; int main()
{
int n,m;
cin>>n;
while(n--)
{
cin>>m;
Tree temp;
temp.isDrop=false;
for(int i=0;i<m;i++)
{
int tempp;
cin>>tempp;
if(i==0)
{
// temp.base=tempp;
temp.end=tempp;
continue;
}
if(tempp<=0)
{
//temp.subtract.push_back(tempp);
temp.end+=tempp;
}
else
{
if(temp.end!=tempp)
{
temp.isDrop=true;
temp.end=tempp;
}
}
}
tree.push_back(temp);
}
int t=0,d=0,e=0;
for(int i=0;i<tree.size();i++)
{
t+=tree[i].end;
if(tree[i].isDrop)
d++;
if(i==0&&tree[0].isDrop&&tree[1].isDrop&&tree[tree.size()-1].isDrop)
e++;
else if((i==tree.size()-1)&&tree[0].isDrop&&tree[tree.size()-2].isDrop&&tree[tree.size()-1].isDrop)
e++;
else
{
if(tree[i-1].isDrop&&tree[i].isDrop&&tree[i+1].isDrop)
e++;
}
}
cout<<t<<" "<<d<<" "<<e<<endl;
} /*
4
4 74 -7 -12 -5
5 73 -8 -6 59 -4
5 76 -5 -10 60 -2
5 80 -6 -15 59 0
*/

最新文章

  1. half extents
  2. 微冷的雨之Java中的多线程初理解(一)
  3. 【poj2459】 Feed Accounting
  4. javascript设置网页刷新或者重新加载后滚动条的位置不变
  5. LightOj1137 - Expanding Rods(二分+数学)
  6. mvc annotation-driven作用
  7. [学习笔记]--Jfinal 表单提交附件
  8. 【贪心】【TOJ4107】【A simple problem】
  9. 突然兴起复习一下Swift3.0
  10. 关于UIView用户交互相关的属性和方法
  11. Android上的Badge,快速实现给应用添加角标
  12. Java多线程——中断机制
  13. 清北学堂part1
  14. 我的C++ 学习心得
  15. QuickStart系列:docker部署之redis
  16. WPF背景透明内嵌WebBrowser不显示问题,即AllowsTransparency = true 和 Webbrowser 等控件显示冲突
  17. 怎么给kibana加上权限?
  18. shell编程中用户输入处理(shell 04)
  19. sc&quot;
  20. 【SSH】——spring的控制反转和依赖注入

热门文章

  1. 【已解决】SQL2012启动时报错:cannot find one or more cpmponents
  2. 让你VS Code的通过插件扩展,拥有了三头六臂
  3. 学习Java Day16
  4. G - 逆序对的数量
  5. 微信小程序【关于地址信息的接入以及自动选择当前位置】
  6. 三元运算符整体执行情况:Object obj = true? Integer.valueOf(1): Double.valueOf(2.0);
  7. 免杀之:C# XOR Shellcode
  8. SQL 注入之一:Mysql 数据库(搞懂这篇就够了)
  9. [专题总结]Gridea快速免费搭建个人博客
  10. CF825F - String Compression