結果

問題 No.923 オセロきりきざむたん
ユーザー milanis48663220milanis48663220
提出日時 2019-11-08 22:32:23
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 1,128 bytes
コンパイル時間 2,909 ms
コンパイル使用メモリ 74,684 KB
実行使用メモリ 8,912 KB
最終ジャッジ日時 2023-10-13 05:32:54
合計ジャッジ時間 3,737 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,700 KB
testcase_01 AC 3 ms
5,980 KB
testcase_02 AC 4 ms
5,768 KB
testcase_03 AC 3 ms
5,692 KB
testcase_04 AC 3 ms
5,812 KB
testcase_05 AC 3 ms
5,700 KB
testcase_06 AC 3 ms
5,708 KB
testcase_07 AC 3 ms
5,760 KB
testcase_08 AC 3 ms
5,840 KB
testcase_09 AC 3 ms
5,836 KB
testcase_10 AC 3 ms
5,756 KB
testcase_11 AC 3 ms
5,764 KB
testcase_12 AC 3 ms
5,708 KB
testcase_13 AC 3 ms
5,708 KB
testcase_14 AC 3 ms
5,696 KB
testcase_15 AC 3 ms
5,708 KB
testcase_16 AC 3 ms
5,780 KB
testcase_17 AC 4 ms
5,776 KB
testcase_18 AC 3 ms
5,820 KB
testcase_19 AC 4 ms
5,692 KB
testcase_20 AC 4 ms
5,756 KB
testcase_21 AC 3 ms
5,760 KB
testcase_22 AC 3 ms
5,812 KB
testcase_23 AC 3 ms
5,940 KB
testcase_24 AC 3 ms
5,712 KB
testcase_25 AC 3 ms
5,800 KB
testcase_26 AC 6 ms
6,672 KB
testcase_27 AC 6 ms
6,264 KB
testcase_28 AC 6 ms
6,196 KB
testcase_29 AC 6 ms
6,304 KB
testcase_30 AC 5 ms
6,196 KB
testcase_31 AC 5 ms
6,216 KB
testcase_32 AC 4 ms
5,716 KB
testcase_33 AC 3 ms
5,764 KB
testcase_34 AC 4 ms
6,044 KB
testcase_35 AC 3 ms
5,716 KB
testcase_36 AC 3 ms
5,788 KB
testcase_37 AC 3 ms
5,708 KB
testcase_38 AC 3 ms
5,784 KB
testcase_39 AC 4 ms
5,728 KB
testcase_40 AC 4 ms
5,852 KB
testcase_41 AC 3 ms
5,728 KB
testcase_42 AC 3 ms
5,800 KB
testcase_43 AC 4 ms
5,712 KB
testcase_44 AC 4 ms
5,780 KB
testcase_45 AC 3 ms
5,800 KB
testcase_46 AC 3 ms
5,732 KB
testcase_47 AC 3 ms
5,756 KB
testcase_48 AC 3 ms
5,712 KB
testcase_49 AC 3 ms
5,720 KB
testcase_50 AC 7 ms
6,428 KB
testcase_51 AC 7 ms
6,460 KB
testcase_52 AC 7 ms
6,340 KB
testcase_53 AC 10 ms
7,268 KB
testcase_54 AC 8 ms
6,464 KB
testcase_55 AC 8 ms
6,628 KB
testcase_56 AC 8 ms
6,972 KB
testcase_57 AC 4 ms
5,792 KB
testcase_58 AC 3 ms
5,896 KB
testcase_59 AC 3 ms
5,804 KB
testcase_60 AC 3 ms
6,064 KB
testcase_61 AC 3 ms
5,716 KB
testcase_62 AC 3 ms
5,756 KB
testcase_63 AC 3 ms
5,812 KB
testcase_64 AC 3 ms
5,800 KB
testcase_65 AC 12 ms
8,832 KB
testcase_66 AC 12 ms
8,828 KB
testcase_67 AC 12 ms
8,912 KB
testcase_68 AC 12 ms
8,836 KB
testcase_69 AC 5 ms
6,112 KB
testcase_70 AC 5 ms
6,056 KB
testcase_71 AC 12 ms
8,828 KB
testcase_72 AC 6 ms
5,976 KB
testcase_73 AC 4 ms
5,732 KB
testcase_74 AC 4 ms
5,892 KB
testcase_75 AC 5 ms
6,132 KB
testcase_76 AC 4 ms
5,892 KB
testcase_77 AC 5 ms
5,960 KB
testcase_78 AC 3 ms
5,888 KB
testcase_79 AC 5 ms
6,204 KB
testcase_80 AC 5 ms
6,176 KB
testcase_81 AC 5 ms
6,188 KB
testcase_82 AC 5 ms
6,384 KB
testcase_83 AC 4 ms
5,900 KB
testcase_84 AC 6 ms
6,388 KB
testcase_85 AC 5 ms
6,380 KB
testcase_86 AC 5 ms
5,888 KB
testcase_87 AC 5 ms
5,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

vector<int> A[100000];

bool all_0_row, all_1_row, all_0_col, all_1_col;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    int H, W;
    cin >> H >> W;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            char c;
            cin >> c;
            int a = c-'0';
            A[i].push_back(a);
        }
    }
    for(int i = 0; i < H; i++){
        int cnt = 0;
        for(int j = 0; j < W; j++){
            cnt += A[i][j];
        }
        if(cnt == W) all_1_row = true;
        if(cnt == 0) all_0_row = true;
    }

    for(int j = 0; j < W; j++){
        int cnt = 0;
        for(int i = 0; i < H; i++){
            cnt += A[i][j];
        }
        if(cnt == H) all_1_col = true;
        if(cnt == 0) all_0_col = true;
    }
    if(all_0_col && all_0_row) cout << "NO" << endl;
    else if(all_1_col && all_1_row) cout << "NO" << endl;
    else cout << "YES" << endl;
}
0