結果

問題 No.179 塗り分け
ユーザー kuuso1kuuso1
提出日時 2015-04-05 23:54:29
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,596 bytes
コンパイル時間 1,277 ms
コンパイル使用メモリ 115,628 KB
実行使用メモリ 26,160 KB
最終ジャッジ日時 2024-04-10 11:20:59
合計ジャッジ時間 3,523 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
25,972 KB
testcase_01 AC 26 ms
26,100 KB
testcase_02 AC 26 ms
24,060 KB
testcase_03 AC 26 ms
22,072 KB
testcase_04 AC 27 ms
23,812 KB
testcase_05 AC 27 ms
26,100 KB
testcase_06 AC 26 ms
24,000 KB
testcase_07 AC 26 ms
23,968 KB
testcase_08 AC 26 ms
23,860 KB
testcase_09 AC 26 ms
25,912 KB
testcase_10 AC 27 ms
24,112 KB
testcase_11 AC 26 ms
26,096 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 27 ms
23,996 KB
testcase_15 AC 27 ms
26,012 KB
testcase_16 AC 26 ms
25,844 KB
testcase_17 AC 26 ms
25,880 KB
testcase_18 AC 25 ms
23,988 KB
testcase_19 AC 26 ms
23,924 KB
testcase_20 AC 28 ms
25,904 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 29 ms
26,160 KB
testcase_24 WA -
testcase_25 AC 26 ms
24,236 KB
testcase_26 AC 26 ms
23,804 KB
testcase_27 WA -
testcase_28 AC 26 ms
24,108 KB
testcase_29 AC 29 ms
26,036 KB
testcase_30 AC 28 ms
21,940 KB
testcase_31 WA -
testcase_32 AC 28 ms
26,036 KB
testcase_33 AC 30 ms
25,792 KB
testcase_34 AC 27 ms
25,968 KB
testcase_35 WA -
testcase_36 AC 25 ms
24,116 KB
testcase_37 WA -
testcase_38 AC 26 ms
24,060 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 26 ms
23,932 KB
testcase_42 WA -
testcase_43 AC 25 ms
23,864 KB
testcase_44 AC 26 ms
23,928 KB
testcase_45 AC 26 ms
24,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		found=false;
		int i0=-1;int j0=-1;
		for(int i=0;i<N;i++){
			for(int j=0;j<M;j++){
				if(S[i][j]=='.')continue;
				if(i0==-1){
					i0=i;j0=j;
					continue;
				}
				if(!found){
					check(i-i0,j-j0);
				}
			}
		}
		Console.WriteLine(found?"YES":"NO");
	}
	
	void check(int offi,int offj){
		if(found)return;
		bool[,] brd=new bool[N,M];
		bool chk=true;
		for(int i=0;i<N;i++){
			for(int j=0;j<M;j++){
				if(S[i][j]=='.')continue;
				if(brd[i,j]==true)continue;
				if(i+offi<N && i+offi>=0 && j+offj<M && j+offj>=0){
					brd[i,j]=true;
					if(brd[i+offi,j+offj])return;
					brd[i+offi,j+offj]=true;
				}else{
					return;
				}
			}
		}
		if(chk)found=true;
	}
	
	
	
	
	bool found;
	
	int N,M;
	String[] S;
	public Sol(){
		var d=ria();
		N=d[0];M=d[1];
		S=new String[N];
		for(int i=0;i<N;i++)S[i]=rs();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0