結果

問題 No.455 冬の大三角
ユーザー YamaKasaYamaKasa
提出日時 2018-09-22 14:49:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,025 bytes
コンパイル時間 1,983 ms
コンパイル使用メモリ 74,168 KB
実行使用メモリ 58,284 KB
最終ジャッジ日時 2023-09-25 11:02:55
合計ジャッジ時間 14,001 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,904 KB
testcase_01 WA -
testcase_02 AC 160 ms
56,060 KB
testcase_03 AC 121 ms
55,796 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 120 ms
55,668 KB
testcase_07 WA -
testcase_08 AC 283 ms
58,284 KB
testcase_09 AC 123 ms
55,608 KB
testcase_10 AC 122 ms
56,052 KB
testcase_11 AC 121 ms
55,524 KB
testcase_12 AC 123 ms
55,844 KB
testcase_13 WA -
testcase_14 AC 123 ms
55,764 KB
testcase_15 AC 121 ms
55,540 KB
testcase_16 AC 119 ms
56,028 KB
testcase_17 WA -
testcase_18 AC 121 ms
55,572 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 121 ms
55,504 KB
testcase_22 AC 122 ms
55,704 KB
testcase_23 AC 120 ms
55,520 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 123 ms
55,936 KB
testcase_27 AC 121 ms
55,504 KB
testcase_28 AC 123 ms
55,872 KB
testcase_29 AC 236 ms
56,816 KB
testcase_30 AC 193 ms
55,860 KB
testcase_31 AC 188 ms
55,976 KB
testcase_32 AC 186 ms
55,828 KB
testcase_33 AC 247 ms
56,652 KB
testcase_34 AC 144 ms
55,848 KB
testcase_35 AC 225 ms
56,720 KB
testcase_36 AC 186 ms
55,864 KB
testcase_37 AC 179 ms
55,836 KB
testcase_38 AC 181 ms
56,116 KB
testcase_39 AC 243 ms
56,820 KB
testcase_40 AC 204 ms
56,260 KB
testcase_41 AC 184 ms
56,256 KB
testcase_42 AC 181 ms
55,604 KB
testcase_43 AC 168 ms
56,104 KB
testcase_44 AC 164 ms
57,752 KB
testcase_45 AC 230 ms
56,496 KB
testcase_46 AC 188 ms
55,820 KB
testcase_47 AC 187 ms
56,104 KB
testcase_48 AC 191 ms
56,448 KB
testcase_49 AC 124 ms
56,128 KB
testcase_50 AC 127 ms
56,080 KB
testcase_51 AC 141 ms
55,752 KB
testcase_52 WA -
testcase_53 AC 158 ms
56,272 KB
testcase_54 AC 144 ms
55,676 KB
testcase_55 AC 170 ms
55,708 KB
testcase_56 AC 145 ms
55,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int H = scan.nextInt();
		int W = scan.nextInt();
		int[]r = new int[3];
		int[]c = new int[3];
		int idx = 0;
		char [][]s = new char[H][W];
		for(int i = 0; i < H; i++) {
			for(int j = 0; j < W; j++) {
				s[i][j] = '-';
			}
		}
		for(int i = 0; i < H; i++) {
			String t = scan.next();
			for(int j = 0; j < W; j++) {
				char ch = t.charAt(j);
				if(ch == '*') {
					r[idx] = i;
					c[idx] = j;
					s[i][j] = '*';
					idx++;
				}
			}
		}
		loop: for(int i = 0; i < H; i++) {
			for(int j = 0; j < W; j++) {
				boolean flag = true;
				for(int k = 0; k < 2; k++) {
					if(r[k] == i && c[j] == i) {
						flag = false;
						continue;
					}
				}
				if(flag) {
					r[2] = i;
					c[2] = j;
					break loop;
				}
			}
		}
		s[r[2]][c[2]] = '*';
		for(int i = 0; i < H; i++) {
			for(int j = 0; j < W; j++) {
				System.out.print(s[i][j]);
			}
			System.out.println();
		}
	}
}
0