結果

問題 No.293 4>7の世界
ユーザー zazaboonzazaboon
提出日時 2017-02-21 23:48:55
言語 Ruby
(3.3.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 706 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-08-28 22:18:51
合計ジャッジ時間 3,157 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,184 KB
testcase_01 AC 80 ms
15,140 KB
testcase_02 AC 81 ms
15,164 KB
testcase_03 AC 81 ms
15,152 KB
testcase_04 AC 82 ms
15,300 KB
testcase_05 AC 81 ms
15,340 KB
testcase_06 AC 81 ms
15,152 KB
testcase_07 AC 80 ms
15,308 KB
testcase_08 AC 80 ms
15,248 KB
testcase_09 AC 81 ms
15,172 KB
testcase_10 AC 80 ms
15,268 KB
testcase_11 AC 81 ms
15,312 KB
testcase_12 AC 81 ms
15,196 KB
testcase_13 AC 80 ms
15,296 KB
testcase_14 AC 80 ms
15,280 KB
testcase_15 AC 80 ms
15,156 KB
testcase_16 AC 79 ms
15,288 KB
testcase_17 AC 80 ms
15,160 KB
testcase_18 AC 80 ms
15,292 KB
testcase_19 AC 80 ms
15,136 KB
testcase_20 AC 80 ms
15,156 KB
testcase_21 AC 80 ms
15,320 KB
testcase_22 AC 79 ms
15,056 KB
testcase_23 AC 78 ms
15,268 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - a
Syntax OK

ソースコード

diff #

def inp() a=gets.chomp.split(" ").map(&:to_i)end 
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaizyo(n)(n < 2)? 1 : (2..n).inject(:*) end
def scount(a,b) a.each{|n|b[n]+=1} end
a,b = gets.chomp.split(" ")
a = a.split("")
b = b.split("")
unless(a.size == b.size)
  if(a.size > b.size)
    puts a.join
  else
    puts b.join
  end
  exit
end
a.map!(&:to_i)
b.map!(&:to_i)
a.size.times do |d|
  if([4,7].include?(a[d]) and [4,7].include?(b[d]))
    if(a[d] == 4 and b[d] == 7)
      puts a.join
      exit
    elsif(a[d] == 7 and b[d] == 4)
      puts b.join
      exit
    end
  else
    if(a[d] > b[d])
      puts a.join
      exit
    elsif(a[d] < b[d])
      puts b.join
      exit
    end
  end
end
0