List manipulation: position & max value combination

dat = {{0, 0, 0}, {1, 1, 2}, {2, 3, 3}, {3, 4, 5}};

f[a_] := {#, Position[a, #, 1, 1][[1, 1]]} & @ Max[a]

Transpose[f /@ dat]
{{0, 2, 3, 5}, {1, 3, 2, 3}}

Since your lists are "very long" here is a faster method using my favorite trick: SparseArray Properties.

f2[a_] := {#, First @ SparseArray[UnitStep[a - #]]["AdjacencyLists"]} & @ Max @ a

Transpose[f2 /@ dat]
{{0, 2, 3, 5}, {1, 3, 2, 3}}

Performance comparison on a big array:

dat = RandomInteger[1*^9, {1000, 100000}];

Transpose[f /@ dat]  // Timing // First
Transpose[f2 /@ dat] // Timing // First
3.9

0.515

Update

Reminded of this question it occurs to me that R.M's Ordering solution can be modified to give the desired output by negating the list:

f3[x_] := {x[[#]], #} & @@ Ordering[-x, 1]

Compared in Mathematica 10.1:

r2 = Transpose[f2 /@ dat]; // RepeatedTiming
r3 = Transpose[f3 /@ dat]; // RepeatedTiming

r2 === r3
{0.649, Null}

{0.478, Null}

True

Using Ordering is another option, and more efficient if you have long lists/sublists:

dat = {{0, 1, 0}, {3, 1, 2}, {2, 3, 4}, {5, 3, 4}}; (* different example with a unique max *)
With[{l = #}, Composition[{l[[#]], #} &, Last, Ordering]@#] & /@ dat // Transpose
(* {{1, 3, 4, 5}, {2, 1, 3, 1}} *)

Note that if you have more than one element that is the maximum, then Ordering will only give you the last index.


Another option:

list = {{0, 0, 0}, {1, 1, 2}, {2, 3, 3}, {3, 4, 5}}

maxWithPosition[list_] := 
 With[{max = Max /@ list}, {max, 
   MapThread[Position, {list, max}][[All, 1, 1]]}]

maxWithPosition[list]
{{0, 2, 3, 5}, {1, 3, 2, 3}}