結果

問題 No.923 オセロきりきざむたん
ユーザー pockynypockyny
提出日時 2019-11-09 15:42:43
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 728 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 74,712 KB
実行使用メモリ 9,116 KB
最終ジャッジ日時 2023-10-13 07:18:19
合計ジャッジ時間 4,412 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,828 KB
testcase_01 AC 3 ms
5,672 KB
testcase_02 AC 4 ms
5,764 KB
testcase_03 AC 3 ms
5,728 KB
testcase_04 AC 3 ms
5,712 KB
testcase_05 AC 3 ms
5,676 KB
testcase_06 AC 4 ms
5,700 KB
testcase_07 AC 3 ms
5,708 KB
testcase_08 AC 3 ms
5,764 KB
testcase_09 AC 3 ms
5,704 KB
testcase_10 AC 3 ms
5,984 KB
testcase_11 AC 3 ms
5,712 KB
testcase_12 AC 3 ms
5,716 KB
testcase_13 AC 3 ms
5,848 KB
testcase_14 AC 3 ms
5,812 KB
testcase_15 AC 3 ms
5,672 KB
testcase_16 AC 3 ms
5,668 KB
testcase_17 AC 4 ms
5,652 KB
testcase_18 AC 3 ms
5,672 KB
testcase_19 AC 3 ms
5,672 KB
testcase_20 AC 4 ms
5,788 KB
testcase_21 AC 3 ms
5,720 KB
testcase_22 AC 3 ms
5,744 KB
testcase_23 AC 4 ms
5,748 KB
testcase_24 AC 3 ms
5,984 KB
testcase_25 AC 4 ms
5,744 KB
testcase_26 AC 7 ms
6,408 KB
testcase_27 AC 6 ms
6,448 KB
testcase_28 AC 6 ms
6,428 KB
testcase_29 AC 6 ms
6,324 KB
testcase_30 AC 5 ms
5,896 KB
testcase_31 AC 6 ms
6,232 KB
testcase_32 AC 3 ms
5,708 KB
testcase_33 AC 3 ms
5,684 KB
testcase_34 AC 3 ms
5,912 KB
testcase_35 AC 3 ms
5,728 KB
testcase_36 AC 3 ms
5,688 KB
testcase_37 AC 3 ms
5,832 KB
testcase_38 AC 3 ms
5,992 KB
testcase_39 AC 4 ms
5,728 KB
testcase_40 AC 3 ms
5,748 KB
testcase_41 AC 3 ms
5,776 KB
testcase_42 AC 3 ms
5,792 KB
testcase_43 AC 3 ms
5,784 KB
testcase_44 AC 3 ms
5,692 KB
testcase_45 AC 4 ms
5,740 KB
testcase_46 AC 3 ms
5,788 KB
testcase_47 AC 4 ms
5,760 KB
testcase_48 AC 3 ms
5,692 KB
testcase_49 AC 4 ms
5,696 KB
testcase_50 AC 10 ms
6,448 KB
testcase_51 AC 10 ms
6,376 KB
testcase_52 AC 9 ms
6,480 KB
testcase_53 AC 16 ms
7,236 KB
testcase_54 AC 10 ms
6,416 KB
testcase_55 AC 11 ms
6,600 KB
testcase_56 AC 11 ms
6,648 KB
testcase_57 AC 4 ms
5,744 KB
testcase_58 AC 3 ms
5,784 KB
testcase_59 AC 4 ms
5,816 KB
testcase_60 AC 3 ms
5,712 KB
testcase_61 AC 4 ms
5,776 KB
testcase_62 AC 3 ms
5,776 KB
testcase_63 AC 4 ms
5,760 KB
testcase_64 AC 3 ms
5,736 KB
testcase_65 AC 23 ms
8,896 KB
testcase_66 AC 23 ms
9,100 KB
testcase_67 AC 22 ms
8,800 KB
testcase_68 AC 22 ms
9,116 KB
testcase_69 AC 6 ms
6,200 KB
testcase_70 AC 6 ms
6,216 KB
testcase_71 AC 23 ms
8,848 KB
testcase_72 AC 6 ms
6,268 KB
testcase_73 AC 4 ms
5,736 KB
testcase_74 AC 4 ms
5,952 KB
testcase_75 AC 6 ms
6,096 KB
testcase_76 AC 4 ms
6,000 KB
testcase_77 AC 5 ms
6,188 KB
testcase_78 AC 3 ms
6,080 KB
testcase_79 AC 5 ms
6,060 KB
testcase_80 AC 6 ms
6,420 KB
testcase_81 AC 5 ms
6,252 KB
testcase_82 AC 6 ms
6,220 KB
testcase_83 AC 4 ms
5,976 KB
testcase_84 AC 6 ms
6,448 KB
testcase_85 AC 6 ms
6,384 KB
testcase_86 AC 5 ms
6,040 KB
testcase_87 AC 5 ms
6,324 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