結果

問題 No.2871 Universal Serial Bus
ユーザー rogi52rogi52
提出日時 2024-09-06 22:21:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 54,576 KB
最終ジャッジ日時 2024-09-06 22:21:55
合計ジャッジ時間 1,522 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,340 KB
testcase_01 AC 34 ms
53,560 KB
testcase_02 AC 34 ms
53,752 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 35 ms
53,420 KB
testcase_06 AC 37 ms
54,272 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 34 ms
53,356 KB
testcase_10 WA -
testcase_11 AC 34 ms
52,748 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 34 ms
53,272 KB
testcase_15 AC 33 ms
53,328 KB
testcase_16 WA -
testcase_17 AC 33 ms
53,072 KB
testcase_18 AC 35 ms
54,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
S = [input() for _ in range(H)]
T = [input() for _ in range(H)]

ok1, ok2 = True, True
for i in range(H):
    for j in range(W):
        ok1 &= S[i][j] != T[i][j]
        ok2 &= S[i][j] != T[H - 1 - i][W - 1 - j]

if ok1 and ok2:
    ans = 0
    for n in range(1, 100):
        ans += n * (pow(2, -(n-2)*(n-1)/2) - pow(2, -(n-1)*n/2))
    print(ans)
elif ok1 and not ok2:
    print(3.5317401904617327)
elif not ok1 and ok2:
    ans = 0
    for n in range(1, 100):
        ans += n * (pow(2, -n*(n-1)/2) - pow(2, -((n-1) * (n) / 2 + 2 * n - 1)))
    print(ans)
else:
    print(0)
0