AOJ

AOJ (Introduction to Algorithms and Data Structures)

AIZU ONLINE JUDGE: Programming Challenge ALDS1_1_A #挿入ソート gets ar = gets.split.map(&:to_i) n = ar.size putout = ->{puts ar.join(" ")} putout.() 1.upto(n - 1) do |i| v = ar[i] j = i - 1 while j >= 0 and ar[j] > v ar[j + 1] = ar[j] j -=…

AOJ (Introduction to Programming)

AIZU ONLINE JUDGE: Programming ChallengeITP1_1_A puts "Hello World" ITP1_1_B x = gets.to_i puts x ** 3 ITP1_1_C a, b = gets.split.map(&:to_i) puts "#{a * b} #{2 * (a + b)}" ITP1_1_D n = gets.to_i puts "#{n / 3600}:#{(n % 3600) / 60}:#{n % …