CSP 201901小明种苹果C++题解 #include<iostream> //#include<fstream> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); //ifstream cin("input.txt"); ll N, M; cin >> N >> M; ll minout = 0, mintree=1; ll total = 0; for (ll i = 1; i <= N; ++i) { ll apple; cin >> apple; total += apple; ll k = 0; ll a; for (int j = 0; j <M; ++j) { cin >> a; k += a; } total += k; if (k <minout) { minout = k; mintree = i; } } cout << total << " " << mintree<<" "<<(minout*-1); return 0; }