#include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
vector<int> trees(N);
vector<bool> drop(N, 0);
int T = 0;
int D = 0;
int E = 0;
for (int i = 0; i < N; i++) {
int M = 0;
cin >> M;
for (int j = 0; j < M; j++) {
int cur = 0;
cin >> cur;
if (cur <= 0)
trees[i] += cur;
else {
if (trees[i] != cur && j >= 1 && drop[i] == false) {
D ++;
drop[i] = true;
}
trees[i] = cur;
}
}
T += trees[i];
}
for (int i = 0; i < N; i++) {
if (drop[i % N] == 1 && drop[(i + 1) % N] == 1 && drop[(i + 2) % N] == 1)
E ++;
}
cout << T << " " << D << " " << E << endl;
return 0;
}
之前将一棵苹果掉落的树重复计算,得分50。
加入判定条件修正后,得分100。