eolymp
bolt
Try our new interface for solving problems
Məsələlər

Строки с максимальной суммой

dərc olunub 25.01.23 15:12:48

It is written "All numbers do not exceed 100 by absolute value". It must be 1000 !!!

dərc olunub 10.01.24 17:51:01

include<bits/stdc++.h>

using namespace std; int main(){

long n,m; cin>>n>>m; long arr[n][m]; long maxx=-1001,cem=0; for(long i=0;i<n;i++){ for(long j=0;j<m;j++){ cin>>arr[i][j]; cem+=arr[i][j]; } if(cem>maxx){ maxx=cem; } cem=0; } long sum=0; for(long i=0;i<n;i++){ for(long j=0;j<m;j++){ sum+=arr[i][j]; } if(sum==maxx){ cout<<i+1<<" "; } sum=0; }

}