結果

問題 No.8086 愛国心(2)
ユーザー cielciel
提出日時 2021-04-15 08:41:36
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 6,123 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-07-01 07:51:26
合計ジャッジ時間 1,115 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - sig
Main.rb:5: warning: assigned but unused variable - height
Main.rb:6: warning: assigned but unused variable - depth
Syntax OK

ソースコード

diff #

require 'base64'
require 'zlib'
img = StringIO.new Zlib.inflate Base64.decode64 DATA.read
sig = img.gets.chomp
width, height = img.gets.split.map &:to_i
depth = img.gets.to_i
img = img.read.bytes.each_slice(3).map{|r,g,b|r+g+b}

gets.to_i.times{
x,y=gets.split.map &:to_i
p img[y*width+x]
}

# icon.ppm.zlib.b64
__END__
eNrtnAdYVWUYx0/7ae9MTUWEK6IyVJANskmGojhSc+TIbVlaVpamOdJSy9yaI0eOcm8xy8pcaZoL
3Aq4xS1K/c758HQ4xJHLFbxcPM95eC73nvOd9/uf932/d351PB9zd3O38/J+rJqHx2P/3DuK7JF5
6/jn3mGI0s2b2SC6B1ruQN1U/z195syBg4du3LiR7dd7Rw4ojh1P+XH+oqYt2pvcQwcNGb5p89ZL
ly6pv8pXFk9ey8wmaDDSrt17xo7/NvTVBpJUqnzVWt5BsZJUWXrQtctb7y1bvvLEiZPFU0J1k714
8dJvv//Rp99ge5dgSXKo4hEeEd0oODLBPzSeD4Hh9e5/paYkOcbVbz55yvSk5P3ae20bNJ0mh2GW
LF3RrsPb0kOu0gvVPQNiwmo3rBVZ36dWHKdvcB0YzD+krviyonuoJDlV9ggfOHiYLKGXL2sl1MZw
03IUs0tO3j9l6oyouNckqU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