結果

問題 No.2267 群の公理
ユーザー lddlinanlddlinan
提出日時 2023-04-16 13:18:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,139 bytes
コンパイル時間 646 ms
コンパイル使用メモリ 84,116 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 04:04:53
合計ジャッジ時間 2,001 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,812 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 WA -
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 WA -
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 WA -
testcase_26 AC 2 ms
6,940 KB
testcase_27 AC 1 ms
6,944 KB
testcase_28 AC 1 ms
6,944 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 2 ms
6,940 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 1 ms
6,944 KB
testcase_35 WA -
testcase_36 AC 1 ms
6,940 KB
testcase_37 AC 1 ms
6,944 KB
testcase_38 AC 1 ms
6,940 KB
testcase_39 WA -
testcase_40 AC 1 ms
6,944 KB
testcase_41 AC 2 ms
6,940 KB
testcase_42 WA -
testcase_43 AC 1 ms
6,944 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 2 ms
6,940 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <algorithm>
#include <array>
#include <unordered_set>
#include <unordered_map>
#include <string>
using namespace std;

bool rcmp(int a, int b) { return a>b; }
typedef long long LL;
class mypcmp {
public:
    bool operator()(const int& a, const int& b) {
        return a<b;
    }
};



int vs[32][32];
int main() {
    int n, i, j, e;
    scanf("%d", &n);
    for (i=0; i<n; i++) for (j=0; j<n; j++) scanf("%d", &vs[i][j]);
    for (i=0; i<n; i++) {
        for (j=i+1; j<n; j++) if (vs[i][j]!=vs[j][i]) break;
        if (j<n) break;
    }
    if (i<n) printf("No\n");
    else {
        for (e=0; e<n; e++) {
            for (i=0; i<n; i++) if (vs[i][e]!=i) break;
            if (i<n) continue;
            for (i=0; i<n; i++) {
                for (j=i; j<n; j++) if(vs[i][j]==e) break;
                if (j>=n) break;
            }
            if (i<n) continue;
            break;
        }
        if (e<n) printf("Yes\n"); else printf("No\n");
    }
    return 0;
}
0