結果

問題 No.2267 群の公理
ユーザー tassei903tassei903
提出日時 2023-04-14 21:38:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 889 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 63,556 KB
最終ジャッジ日時 2024-04-18 19:00:02
合計ジャッジ時間 3,498 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,864 KB
testcase_01 AC 36 ms
53,084 KB
testcase_02 AC 37 ms
53,688 KB
testcase_03 AC 36 ms
53,020 KB
testcase_04 AC 35 ms
51,940 KB
testcase_05 AC 37 ms
53,664 KB
testcase_06 AC 37 ms
52,076 KB
testcase_07 AC 38 ms
52,952 KB
testcase_08 AC 37 ms
53,360 KB
testcase_09 AC 37 ms
54,084 KB
testcase_10 AC 37 ms
52,004 KB
testcase_11 AC 38 ms
53,848 KB
testcase_12 AC 37 ms
52,760 KB
testcase_13 AC 36 ms
53,348 KB
testcase_14 AC 37 ms
52,336 KB
testcase_15 AC 36 ms
52,704 KB
testcase_16 AC 37 ms
52,804 KB
testcase_17 AC 37 ms
53,036 KB
testcase_18 AC 36 ms
53,356 KB
testcase_19 AC 38 ms
52,760 KB
testcase_20 AC 37 ms
53,352 KB
testcase_21 AC 38 ms
52,336 KB
testcase_22 AC 36 ms
53,596 KB
testcase_23 AC 37 ms
54,040 KB
testcase_24 AC 38 ms
53,996 KB
testcase_25 AC 38 ms
52,832 KB
testcase_26 AC 38 ms
53,036 KB
testcase_27 AC 44 ms
61,228 KB
testcase_28 AC 42 ms
58,660 KB
testcase_29 AC 42 ms
60,132 KB
testcase_30 AC 43 ms
60,272 KB
testcase_31 AC 47 ms
61,708 KB
testcase_32 AC 46 ms
61,672 KB
testcase_33 AC 44 ms
60,632 KB
testcase_34 AC 47 ms
61,960 KB
testcase_35 AC 45 ms
62,460 KB
testcase_36 AC 48 ms
63,080 KB
testcase_37 AC 47 ms
63,148 KB
testcase_38 AC 49 ms
63,276 KB
testcase_39 AC 45 ms
62,056 KB
testcase_40 AC 48 ms
62,720 KB
testcase_41 AC 48 ms
63,216 KB
testcase_42 AC 47 ms
61,412 KB
testcase_43 AC 48 ms
63,412 KB
testcase_44 AC 46 ms
61,668 KB
testcase_45 AC 48 ms
62,948 KB
testcase_46 AC 47 ms
61,312 KB
testcase_47 AC 48 ms
63,556 KB
testcase_48 AC 47 ms
63,028 KB
testcase_49 AC 45 ms
61,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
n = ni()
a = [na()for i in range(n)]
ok = 1
for i in range(n):
    for j in range(n):
        for k in range(n):
            if a[a[i][j]][k] != a[i][a[j][k]]:
                ok = 0
f = 0
for e in range(n):
    g = 1
    for i in range(n):
        if not a[e][i] == a[i][e] == i:
            g = 0
    for i in range(n):
        z = 0
        for j in range(n):
            if e == a[i][j] == a[j][i]:
                z = 1
        if z^1:
            g = 0
    if g:
        f = 1
        break

if ok and f:
    Yes()
else:
    No()
0