結果

問題 No.923 オセロきりきざむたん
ユーザー pockyny
提出日時 2019-11-09 15:42:43
言語 C++17(1z)
(gcc 8.3.0)
結果
AC  
実行時間 28 ms
コード長 728 Byte
コンパイル時間 513 ms
使用メモリ 8,924 KB
最終ジャッジ日時 2019-11-09 15:42:47

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
00_sample_1.txt AC 5 ms
6,872 KB
00_sample_2.txt AC 4 ms
6,872 KB
00_sample_3.txt AC 5 ms
6,872 KB
00_sample_4.txt AC 5 ms
6,872 KB
10_hand_1.txt AC 6 ms
6,872 KB
10_hand_2.txt AC 5 ms
6,876 KB
10_hand_3.txt AC 5 ms
8,924 KB
10_hand_4.txt AC 5 ms
6,872 KB
10_hand_5.txt AC 6 ms
6,872 KB
10_hand_6.txt AC 6 ms
6,876 KB
10_hand_7.txt AC 5 ms
6,876 KB
10_hand_8.txt AC 6 ms
6,876 KB
10_hand_9.txt AC 5 ms
6,872 KB
10_hand_10.txt AC 5 ms
6,876 KB
10_hand_11.txt AC 6 ms
6,872 KB
10_hand_12.txt AC 5 ms
6,876 KB
10_hand_13.txt AC 5 ms
6,872 KB
10_hand_14.txt AC 6 ms
6,872 KB
10_hand_15.txt AC 5 ms
6,872 KB
10_hand_16.txt AC 5 ms
6,876 KB
11_hand_1.txt AC 6 ms
6,872 KB
11_hand_2.txt AC 6 ms
6,876 KB
11_hand_3.txt AC 6 ms
6,876 KB
11_hand_4.txt AC 5 ms
6,872 KB
11_hand_5.txt AC 5 ms
6,872 KB
11_hand_6.txt AC 6 ms
6,876 KB
11_hand_7.txt AC 12 ms
6,872 KB
11_hand_8.txt AC 11 ms
6,876 KB
11_hand_9.txt AC 11 ms
6,876 KB
11_hand_10.txt AC 10 ms
6,876 KB
11_hand_11.txt AC 7 ms
6,876 KB
11_hand_12.txt AC 9 ms
6,876 KB
20_general_1.txt AC 6 ms
6,872 KB
20_general_2.txt AC 5 ms
6,872 KB
20_general_3.txt AC 6 ms
6,876 KB
20_general_4.txt AC 6 ms
6,876 KB
21_general_1.txt AC 6 ms
6,876 KB
21_general_2.txt AC 5 ms
6,872 KB
21_general_3.txt AC 5 ms
6,876 KB
21_general_4.txt AC 5 ms
6,876 KB
22_general_1.txt AC 6 ms
6,872 KB
22_general_2.txt AC 5 ms
6,872 KB
22_general_3.txt AC 6 ms
6,872 KB
22_general_4.txt AC 6 ms
8,916 KB
22_general_5.txt AC 6 ms
6,872 KB
22_general_6.txt AC 6 ms
6,876 KB
22_general_7.txt AC 6 ms
6,876 KB
22_general_8.txt AC 6 ms
6,872 KB
22_general_9.txt AC 5 ms
8,920 KB
22_general_10.txt AC 5 ms
6,872 KB
23_general_1.txt AC 14 ms
6,876 KB
23_general_2.txt AC 14 ms
8,916 KB
23_general_3.txt AC 13 ms
6,876 KB
23_general_4.txt AC 20 ms
6,872 KB
23_general_5.txt AC 15 ms
6,876 KB
23_general_6.txt AC 16 ms
6,876 KB
23_general_7.txt AC 16 ms
6,872 KB
23_general_8.txt AC 5 ms
8,916 KB
23_general_9.txt AC 6 ms
8,916 KB
23_general_10.txt AC 6 ms
6,876 KB
23_general_11.txt AC 6 ms
6,872 KB
23_general_12.txt AC 6 ms
8,920 KB
23_general_13.txt AC 6 ms
6,872 KB
23_general_14.txt AC 6 ms
6,876 KB
23_general_15.txt AC 6 ms
6,876 KB
24_general_1.txt AC 28 ms
6,980 KB
24_general_2.txt AC 27 ms
6,980 KB
24_general_3.txt AC 26 ms
6,980 KB
24_general_4.txt AC 28 ms
6,976 KB
24_general_5.txt AC 9 ms
6,876 KB
24_general_6.txt AC 9 ms
6,876 KB
24_general_7.txt AC 27 ms
6,976 KB
24_general_8.txt AC 9 ms
6,876 KB
25_general_1.txt AC 6 ms
6,876 KB
25_general_2.txt AC 7 ms
6,876 KB
25_general_3.txt AC 9 ms
6,876 KB
25_general_4.txt AC 7 ms
6,876 KB
25_general_5.txt AC 10 ms
8,916 KB
25_general_6.txt AC 6 ms
6,876 KB
25_general_7.txt AC 9 ms
6,876 KB
25_general_8.txt AC 10 ms
6,876 KB
25_general_9.txt AC 9 ms
6,872 KB
25_general_10.txt AC 11 ms
6,876 KB
25_general_11.txt AC 9 ms
6,876 KB
25_general_12.txt AC 12 ms
6,872 KB
25_general_13.txt AC 10 ms
6,872 KB
25_general_14.txt AC 12 ms
6,876 KB
25_general_15.txt AC 10 ms
6,872 KB
テストケース一括ダウンロード

ソースコード

diff #
#include <iostream>
#include <vector>
#include <string> 
using namespace std;
vector<int> v[100010];
int main(){
	int i,j,h,w;
	cin >> h >> w;
	for(i=0;i<h;i++){
		string s; cin >> s;
		for(j=0;j<w;j++){
			v[i].push_back(s[j] - '0');
		}
	}
	bool flag1 = false,flag2 = false;
	for(i=0;i<h;i++){
		for(j=0;j<w - 1;j++){
			if(v[i][j]!=v[i][j + 1]) break;
			if(j==w - 2) flag1 = true;
		}
	}
	if(w==1) flag1 = true;
	for(j=0;j<w;j++){
		for(i=0;i<h - 1;i++){
			if(v[i][j]!=v[i + 1][j]) break;
			if(i==h - 2) flag2 = true;
		}
	}
	if(h==1) flag2 = true;
	if(h==1 && w==1){
		if(v[0][0]==1) cout << "YES" << endl;
		else cout << "NO" << endl;
	}else{
		if(flag1 && flag2) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
}
0