問題
https://atcoder.jp/contests/abs/tasks/abc088_b
1回目
回答
N = gets.to_i
A = gets.split.map &:to_i
for i in 0..N-2 do
for j in 0..N-2-i do
if A[j] < A[j+1]
hoji = A[j]
A[j] = A[j+1]
A[j+1] = hoji
end
end
end
i = 0
aliceSum = 0
bobSum = 0
while i < N
aliceSum += A[i]
if i+1 < N
bobSum += A[i+1]
end
i += 2
end
puts aliceSum - bobSum
結果

2回目
回答
N = gets.to_i
A = gets.split.map(&:to_i).sort.reverse
result = 0
for i in 0..N-1
if i % 2 == 0
result += A[i]
else
result -= A[i]
end
end
puts result
結果

感想
sortあるんか〜〜〜〜〜い