結果

問題 No.455 冬の大三角
ユーザー suppy193suppy193
提出日時 2017-02-10 11:59:50
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 11,436 KB
実行使用メモリ 15,476 KB
最終ジャッジ日時 2023-08-27 05:23:09
合計ジャッジ時間 8,930 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 81 ms
15,076 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 87 ms
15,048 KB
testcase_05 WA -
testcase_06 AC 82 ms
15,052 KB
testcase_07 AC 82 ms
15,156 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 82 ms
15,008 KB
testcase_11 WA -
testcase_12 AC 82 ms
15,140 KB
testcase_13 AC 83 ms
15,228 KB
testcase_14 WA -
testcase_15 AC 81 ms
15,212 KB
testcase_16 AC 82 ms
15,080 KB
testcase_17 AC 81 ms
15,316 KB
testcase_18 WA -
testcase_19 AC 82 ms
15,104 KB
testcase_20 AC 83 ms
15,228 KB
testcase_21 WA -
testcase_22 AC 82 ms
15,076 KB
testcase_23 AC 83 ms
15,116 KB
testcase_24 AC 82 ms
15,068 KB
testcase_25 AC 80 ms
15,208 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 83 ms
15,104 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 84 ms
15,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h, w = gets.strip.split(' ').map(&:to_i)
pos = []
(0...h).each do |y|
	s = gets.strip
	(0...s.length).each do |x|
		if s[x] =='*'
			pos << [x, y]
		end
	end
end
# p pos
if pos[1][0] == pos[0][0]
	if pos[1][0] + 1 < w
		x = pos[1][0] + 1
	else
		x = pos[1][0] - 1
	end
	y = pos[1][1]
elsif pos[1][1] == pos[0][1]
	if pos[1][1] + 1 < h
		y = pos[1][1] + 1
	else
		y = pos[1][1] - 1
	end
	x = pos[1][0]
end
pos << [x, y]
# p pos
(0...h).each do |y|
	(0...w).each do |x|
		if pos.include?([x, y])
			print "*"
		else
			print "-"
		end
	end
	print "\n"
end
0