Skip to main content
deleted 8 characters in body
Source Link
Peter Lenkefi
  • 1.7k
  • 10
  • 21

Ruby, 4 tasks in 288280 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map &:to_i;p a.all?{|e|e<a.inject(:+)-e}

Task 2

p gets.split('')chars.permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('')chars.map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index c]};p b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2<1 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a

Ruby, 4 tasks in 288 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map &:to_i;p a.all?{|e|e<a.inject(:+)-e}

Task 2

p gets.split('').permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('').map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index c]};p b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2<1 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a

Ruby, 4 tasks in 280 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map &:to_i;p a.all?{|e|e<a.inject(:+)-e}

Task 2

p gets.chars.permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.chars.map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index c]};p b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2<1 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a
deleted 9 characters in body
Source Link
Peter Lenkefi
  • 1.7k
  • 10
  • 21

Ruby, 4 tasks in 297288 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map( &:to_i);$><<ato_i;p a.all?{|e|e<a.inject(:+)-e}

Task 2

$><<getsp gets.split('').permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('').map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index(c)] c]};$><<b;p b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2==0|i|i%2<1 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a

Ruby, 4 tasks in 297 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map(&:to_i);$><<a.all?{|e|e<a.inject(:+)-e}

Task 2

$><<gets.split('').permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('').map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index(c)]};$><<b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2==0 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a

Ruby, 4 tasks in 288 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map &:to_i;p a.all?{|e|e<a.inject(:+)-e}

Task 2

p gets.split('').permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('').map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index c]};p b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2<1 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a
Just clarifying that unless this is less than 140 bytes it's a non-competitive 420 byte limit
Source Link
Calvin's Hobbies
  • 90k
  • 46
  • 339
  • 555

Ruby, 4 tasks in 297 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map(&:to_i);$><<a.all?{|e|e<a.inject(:+)-e}

Task 2

$><<gets.split('').permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('').map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index(c)]};$><<b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2==0 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a

Ruby, 4 tasks in 297 bytes

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map(&:to_i);$><<a.all?{|e|e<a.inject(:+)-e}

Task 2

$><<gets.split('').permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('').map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index(c)]};$><<b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2==0 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a

Ruby, 4 tasks in 297 bytes (non-competitive)

This is just an attempt, I'll keep making tasks later (and hopefully golf the existing ones).

Task 1

a=gets.split.map(&:to_i);$><<a.all?{|e|e<a.inject(:+)-e}

Task 2

$><<gets.split('').permutation.map{|a|a.join.to_i}.min_by{|x|(x-1e6).abs}

Task 4

n,b='EFHILT',0;gets.split('').map{|c|b+=n[c]==p ? 0:[4,3,3,3,2,2][n.index(c)]};$><<b

Task 5

a='Alex A.';gets.to_i.times{|i|i%2==0 ? a.sub!('A.','.A xelA'):a.sub!('.A',a)};$><<a
Source Link
Peter Lenkefi
  • 1.7k
  • 10
  • 21
Loading