結果

問題 No.3062 A + B
ユーザー 👑 hos.lyrichos.lyric
提出日時 2020-04-01 22:33:26
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 694 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 11,324 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-09-09 19:12:05
合計ジャッジ時間 2,325 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 82 ms
15,040 KB
testcase_04 AC 80 ms
15,092 KB
testcase_05 WA -
testcase_06 AC 80 ms
15,268 KB
testcase_07 WA -
testcase_08 AC 82 ms
15,320 KB
testcase_09 AC 81 ms
15,068 KB
testcase_10 AC 80 ms
15,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def f(s)
  if s=='0' then return 0 end
  if s=='1' then return 1 end
  if s=='2' then return 2 end
  if s=='3' then return 3 end
  if s=='4' then return 4 end
  if s=='5' then return 5 end
  if s=='6' then return 6 end
  if s=='7' then return 7 end
  if s=='8' then return 8 end
  if s=='9' then return 9 end
  if s=='-1' then return -1 end
  if s=='-2' then return -2 end
  if s=='-3' then return -3 end
  if s=='-4' then return -4 end
  if s=='-5' then return -5 end
  if s=='-6' then return -6 end
  if s=='-7' then return -7 end
  if s=='-8' then return -8 end
  if s=='-9' then return -9 end
  s.to_i
end

a,b=gets.split
p f(a)+f(b)
0