Răspuns:
#include <fstream>
using namespace std;
unsigned long long int x[1000];
int main(){
int n, m,y;
ifstream fin("memory001.in");
fin >> m >> n;
for(int j = 0; j < m; j++){
for(int i = 0; i < n; i++){
fin >> y;
x[i]+=y;
}
}
fin.close();
unsigned long long int mx=0, mi=0;
for(int i = 0; i < n; i++){
if(mx == 0 || x[i]<mx){
mx = x[i];
mi = i;
}
}
ofstream fout("memory001.out");
fout << mi+1;
fout.close();
}