結果

問題 No.455 冬の大三角
ユーザー neko_the_shadow
提出日時 2016-12-08 00:44:34
言語 Bash
(Bash 5.2.21)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-28 04:29:27
合計ジャッジ時間 5,630 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/bin/bash

read -s h w

awk -v FS='' '{
	lines[NR] = $0
	print lines[NR]
	if (x != 0) next;
	
	cnt = 0
	for(i = 1; i <= NF; i++) cnt += ($i == "*" ? 1 : 0);
	
	if (cnt == 2) x = (NR != 1) ? i - 1 : i + 1;
	if (cnt == 1) x = i;
} END {
	for (i = 1; i <= length(lines); i++) print(lines[i]);
}' < /dev/stdin
0