fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n,m,a[1000][1000],maxx=0,maxy=0;
  6. cin>>n>>m;
  7. for(int i=0;i<n;i++)
  8. {
  9. for(int j=0;j<m;j++)
  10. {
  11. cin>>a[i][j];
  12. if(a[maxx][maxy]<a[i][j])
  13. {
  14. maxx=i;
  15. maxy=j;
  16. }
  17. }
  18. }
  19. cout<<maxx<<" "<<maxy;
  20. return 0;
  21. }
Success #stdin #stdout 0s 4364KB
stdin
3 4
0 3 2 4
2 3 5 5
5 1 2 3
stdout
1 2