結果

問題 No.3086 愛国心(2)
ユーザー maimai
提出日時 2020-10-11 13:26:53
言語 Ruby
(3.3.0)
結果
AC  
実行時間 100 ms / 5,000 ms
コード長 6,264 bytes
コンパイル時間 36 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 13,312 KB
最終ジャッジ日時 2024-07-19 19:29:44
合計ジャッジ時間 1,450 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
12,416 KB
testcase_01 AC 100 ms
13,312 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

H = 89
W = 101

data='eNrtXAdYVMcWnmjKl8Q0X6KxoIKwFKnSkaXvLihFkaJRoyZRA9ZoEl9M4nsafbaYoIm9RTFij10RATWaaECNLaABFRCwgNJVQPL+mYH17gILuxQp7nc/vmX37r0z/z3nzP+fOTP//PPs1VxfZRWvZ1CoRunx47LKuD1DpiqgHsv/zb537/qNlNLS0iq/fQaU/N/0jMxdu/cNHREisvCY9+2i+DPnCgsL5d/SM1unrZUpOBoMKSHxysrVP3n0DSKks7aJq72LLyG9yPNmEz7596HIqDt37rZOD1XqbEFB4e+n/pgxa76OqRshusbWUpn3IDfPQLGHP944Swe26WpLiJ5fwPD1GzYlJV8T/rZlg6YUyWEwBw4eHhM6mbxgRt62tHHykfQLdvUMcHD1w9HHrT8MTOw+gH+ob+FBiEEva+nc+WHUQ4uKhB7awnATWhR6l5x8bUN4hJffe4RodTZwcpYMdPcKhCHJgRIcfvYufo7uA4AYzrF19qHYEqNxE6dGHo6+c/duSwJNye8ePHhw5sy5BQsXw0gAlLGNDJbj5hkAEwIylYBSOPi3ThJ/BDdXWcBrPexxhf6BIzZsjBB6aDMNa0rNBjGIOhIzaco00tEatmEj9pb5DHaRBVRlTjUc/HyABqj1zN0J0Taz85w7//u4+LNFAg9tDNzKqnlf/YeVm/SYveT/pqambdq8LWDw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nrP3gN3s7KUtnpQmuPjk8sNsZtEVlb23n0HB78/BjGto8iRroPrF6zBSu36tS75lAEGvjdpvaLhyI/GH4o8Ilyh0KjbPyp6N5pxKDLqozGTQDme17KlBZAMtNp3s77g4mdK+ITUu3T/q9AJn0XHHM3Ly6uT6zXAjhx5bGaf1cyLSCdrXsTLqkb9arPQoC5w8bBJpzvZ4iPyVm8ANeXzryFnCgoKm8KWQdWBVlhYePK3U59OnU63BOloLXanXXCW1LB+SmO45Av2PfhkentL0sZs2tezTv8R/6BibXXT3DVOaQuvuPgzX06fTXemamdh5+xLNzqrvtxXA7ie7A7UL5iWub5g9pq2w4xZ886eO/+ooqC66W+vJ2xhSUnJuT/Pz57z7bv6YsRbO1YYVmXNkrpwVQg9vveUPgY+6LULFy8J9/JtRvsQKuwi+/gxrVwNW8KUVE87Z7rnp5L8rCVc5UJP4o8rMKC0Qfwg9BISrjT3DRuVqBreX72atGTZarYOSBd6ijOiJ8v9VMLFgeLDB1vrp2tm57Vi5dqk5Gtq65fmAxpVUtdvrF6zHjqXlvtaSflab/A0F1lAZwMnJbjgxYAI3/JV4WyFkUjsAaG3MUUDodesQBP2KDXt5obwCFYSrC0yd0e4hqoC0VWqTX1Hz9HL9z18y3Y20PHye09J6LXsLaDLFPltRmbm1m07mZLqbGorM7GRgVXK4Ro38XNja6mprSchnfyDR26jQu92KwFKhZK6c+fu7r37hwz/mC5DGBHCC8ULCgreZ8sQho0Mhc4SbrfYJLavV3+b2WpPq0atV7YHYd7yfk7O7j37/zNjTi4TLLm5uTNnzYcili+wwm+rzHOqZ2NlVbW8AbaZrT1cCu0vqzp8VQdjXn4+X1dbXFws1y+qXe/pwNUExoJ6QKOVvVrPBv6t5/V/GABmYA=='

require 'zlib'
require 'base64'

r = Zlib.inflate(Base64.decode64(data))
@img = r.unpack('C*').each_slice(3).to_a

def solve(y,x)
  @img[y*W+x].reduce(:+).to_s
end

gets.to_i.times do
  y,x = gets.split.map(&:to_i)  
  puts solve(y,x)
end
0