提出 #42912239


ソースコード 拡げる

(AH,AW,A),(BH,BW,B),(XH,XW,X) = 3.times.map{
	h,w = gets.split.map(&:to_i)
	g = h.times.map{ gets.chomp.tr('.#','01').to_i(2) }
	g.shift while g[0]<1
	g.pop while g[-1]<1
	g.map!{|r| r/2 } while g.all?{|r| r&1<1 }
	next g.size,g.max.bit_length,g
}
puts [0,XW-AW].any?{|awi|
	next if awi<0
	as = A.map{|a| a<<awi }
	[0,XH-AH].any?{|ahi|
		next if ahi<0
		[0,XW-BW].any?{|bwi|
			next if bwi<0
			bs = B.map{|b| b<<bwi }
			[0,XH-BH].any?{|bhi|
				next if bhi<0
				next unless bs.zip(X[bhi..]).all?{|b,x| b&x==b }
				xs = X.map{0}
				as.each.with_index(ahi){|a,i|
					xs[i] |= a
				}
				bs.each.with_index(bhi){|b,i|
					xs[i] |= b
				}
				next xs==X
			}
		} if as.zip(X[ahi..]).all?{|a,x| a&x==a }
	}
}?'Yes':'No'

提出情報

提出日時
問題 C - Ideal Sheet
ユーザ ds14050
言語 Ruby (2.7.1)
得点 0
コード長 755 Byte
結果 RE
実行時間 67 ms
メモリ 14344 KiB

コンパイルエラー

./Main.rb:2: warning: assigned but unused variable - w

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 300
結果
AC × 4
AC × 27
WA × 4
RE × 1
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt, example_03.txt
All example_00.txt, example_01.txt, example_02.txt, example_03.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, random2_00.txt, random2_01.txt, random2_02.txt, random2_03.txt, random2_04.txt, random2_05.txt, random2_06.txt, random2_07.txt, random2_08.txt, random2_09.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 67 ms 14160 KiB
example_01.txt AC 62 ms 13948 KiB
example_02.txt AC 59 ms 14176 KiB
example_03.txt AC 60 ms 14200 KiB
hand_00.txt AC 63 ms 14184 KiB
hand_01.txt AC 55 ms 14160 KiB
hand_02.txt AC 59 ms 14344 KiB
hand_03.txt AC 58 ms 14124 KiB
hand_04.txt AC 62 ms 14264 KiB
hand_05.txt AC 60 ms 14060 KiB
hand_06.txt AC 59 ms 14236 KiB
hand_07.txt AC 60 ms 13952 KiB
random2_00.txt AC 57 ms 14168 KiB
random2_01.txt AC 60 ms 14080 KiB
random2_02.txt AC 60 ms 14212 KiB
random2_03.txt AC 58 ms 14064 KiB
random2_04.txt RE 55 ms 14212 KiB
random2_05.txt AC 64 ms 14184 KiB
random2_06.txt AC 55 ms 14100 KiB
random2_07.txt AC 60 ms 14188 KiB
random2_08.txt AC 58 ms 14128 KiB
random2_09.txt AC 58 ms 13952 KiB
random_00.txt WA 61 ms 14164 KiB
random_01.txt AC 59 ms 14164 KiB
random_02.txt AC 58 ms 14028 KiB
random_03.txt AC 60 ms 14300 KiB
random_04.txt WA 60 ms 14148 KiB
random_05.txt AC 60 ms 14016 KiB
random_06.txt AC 58 ms 14052 KiB
random_07.txt WA 59 ms 14196 KiB
random_08.txt AC 59 ms 14232 KiB
random_09.txt WA 56 ms 14104 KiB