結果

問題 No.2446 完全列
ユーザー KudeKude
提出日時 2023-08-25 22:30:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,116 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 10,004 KB
最終ジャッジ日時 2023-08-26 01:34:36
合計ジャッジ時間 2,765 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
9,788 KB
testcase_01 AC 25 ms
9,744 KB
testcase_02 AC 25 ms
10,004 KB
testcase_03 AC 25 ms
9,856 KB
testcase_04 AC 24 ms
9,788 KB
testcase_05 AC 26 ms
9,740 KB
testcase_06 AC 27 ms
9,832 KB
testcase_07 AC 27 ms
9,828 KB
testcase_08 AC 25 ms
9,788 KB
testcase_09 AC 25 ms
9,796 KB
testcase_10 AC 25 ms
9,748 KB
testcase_11 AC 25 ms
9,792 KB
testcase_12 AC 25 ms
9,852 KB
testcase_13 AC 25 ms
9,740 KB
testcase_14 AC 24 ms
9,864 KB
testcase_15 AC 25 ms
9,648 KB
testcase_16 AC 25 ms
9,736 KB
testcase_17 AC 26 ms
9,724 KB
testcase_18 AC 26 ms
9,732 KB
testcase_19 AC 27 ms
9,648 KB
testcase_20 AC 25 ms
9,740 KB
testcase_21 AC 24 ms
9,732 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 26 ms
9,792 KB
testcase_25 AC 25 ms
9,852 KB
testcase_26 AC 25 ms
9,932 KB
testcase_27 AC 25 ms
9,928 KB
testcase_28 AC 24 ms
9,728 KB
testcase_29 AC 26 ms
9,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction
l, m, n = map(int, input().split())
# N->M->L
# A: M->L ... M * L
# B: N->M ... N * M
a = [[0] * l for _ in range(m)]
b = [[0] * m for _ in range(n)]
for j in range(l):
    for i, x in enumerate(map(int, input().split())):
        a[i][j] = Fraction(x, 1)

for j in range(m):
    for i, x in enumerate(map(int, input().split())):
        b[i][j] = Fraction(x, 1)

i = 0
for j in range(m):
    for i0 in range(i, n):
        if b[i0][j]:
            break
    else:
        continue
    b[i], b[i0] = b[i0], b[i]
    c = 1 / b[i][j]
    for j0 in range(j, m):
        b[i][j0] *= c
    for i0 in range(i + 1, n):
        c = b[i0][j]
        for j0 in range(j, m):
            b[i0][j0] -= b[i][j0] * c
    i += 1
b = b[:i]

for u in b:
    if any(sum(u[i] * a[i][j] for i in range(m)) for j in range(l)):
        print('No')
        exit()

todo = [True] * m
for u in b:
    for i in range(m):
        if u[i]:
            todo[i] = False
            break


for i in range(m):
    if not todo[i]:
        continue
    if not any(a[i]):
        print('No')
        exit()

print('Yes')
0