結果

問題 No.455 冬の大三角
ユーザー fal_rnd
提出日時 2016-12-06 22:40:31
言語 Java
(openjdk 23)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 74,464 KB
実行使用メモリ 41,656 KB
最終ジャッジ日時 2024-06-29 21:16:52
合計ジャッジ時間 12,312 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

package src;

import java.util.*;
class C{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		String[] in=new String[s.nextInt()];
		s.next();
		int b=0;
		for(int i=0;i<in.length;++i) {
			in[i]=s.next();
		}
		for(int i=0;i<in.length;++i) {
			if(in[i].matches(".*\\*.*")) {
				if(in[i].matches(".*\\*.*\\*.*")) {
					b=i;
					break;
				}
				in[i]=in[i].replaceFirst("-", "*");
				for(String a:in) {
					System.out.println(a);
				}
				return;
			}
		}
		in[(b+1)%in.length]=in[(b+1)%in.length].replaceFirst("-", "*");
		for(String a:in) {
			System.out.println(a);
		}
	}
}
0