提交时间:2021-05-19 17:34:37

运行 ID: 19675

#include <bits/stdc++.h> using namespace std; struct st { int id; int sum; }; int cmp(st a,st b) { if(a.sum!=b.sum)return a.sum>b.sum; else return a.id<b.id; } int n,k; int a[105][105]; st s[105]; int main() { cin>>n>>k; for(int i=1;i<=k;i++)for(int j=1;j<=n;j++)cin>>a[i][j]; for(int i=1;i<=k;i++)for(int j=1;j<=n;j++)s[j].sum+=a[i][j],s[j].id=j; sort(s+1,s+n+1,cmp); int i=1; while(s[i].sum==s[1].sum)cout<<s[i].id<<endl,i+=99; }