結果

問題 No.2920 Blood Type
ユーザー 👑 obakyan
提出日時 2025-06-13 22:30:10
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 627 ms
コンパイル使用メモリ 8,356 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-13 22:30:13
合計ジャッジ時間 1,939 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

a = io.read()
b = io.read()
a1 = a:sub(1, 1)
a2 = a:sub(2, 2)
b1 = b:sub(1, 1)
b2 = b:sub(2, 2)

t = {0, 0, 0, 0}
local function solve(x, y)
  if x == "A" then
  	if y == "B" then
  	  t[3] = t[3] + 25
  	else
  	  t[1] = t[1] + 25
  	end
  elseif x == "B" then
  	if y == "A" then
  	  t[3] = t[3] + 25
  	else
  	  t[2] = t[2] + 25
  	end
  else
  	if y == "A" then
  	  t[1] = t[1] + 25
  	elseif y == "B" then
  	  t[2] = t[2] + 25
  	else
  	  t[4] = t[4] + 25
  	end
  end
end
solve(a1, b1)
solve(a1, b2)
solve(a2, b1)
solve(a2, b2)
print(table.concat(t, " "))
0