結果

問題 No.2692 How Many Times Reached?
ユーザー Nikkuniku029Nikkuniku029
提出日時 2024-03-22 21:35:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 912 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 83,340 KB
最終ジャッジ日時 2024-03-22 21:35:26
合計ジャッジ時間 7,251 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
60,264 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 40 ms
53,460 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 WA -
testcase_09 AC 38 ms
53,460 KB
testcase_10 WA -
testcase_11 AC 44 ms
53,460 KB
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 37 ms
53,460 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 37 ms
53,460 KB
testcase_19 AC 37 ms
53,460 KB
testcase_20 AC 37 ms
53,460 KB
testcase_21 AC 37 ms
53,460 KB
testcase_22 AC 37 ms
53,460 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 37 ms
53,460 KB
testcase_26 WA -
testcase_27 AC 37 ms
53,460 KB
testcase_28 AC 37 ms
53,460 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 37 ms
53,460 KB
testcase_32 WA -
testcase_33 AC 39 ms
53,460 KB
testcase_34 AC 481 ms
76,560 KB
testcase_35 AC 209 ms
76,304 KB
testcase_36 AC 877 ms
76,688 KB
testcase_37 TLE -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(A):
    res = 0
    M = len(A)
    # 横
    for i in range(M):
        s = set()
        for j in range(M):
            s.add(A[i][j])
        if len(s) == 1 and min(s) == "A":
            res += 1
    # 縦
    for j in range(M):
        s = set()
        for i in range(M):
            s.add(A[i][j])
        if len(s) == 1 and min(s) == "A":
            res += 1
    # 右下
    s = set()
    for i in range(M):
        s.add(A[i][j])
    if len(s) == 1 and min(s) == "A":
        res += 1
    # 右上
    s = set()
    for i in range(M):
        s.add(A[M - 1 - i][i])
    if len(s) == 1 and min(s) == "A":
        res += 1
    return res


N = int(input())
S = [list(input()) for _ in range(N)]
ans = 0
for i in range(N):
    for j in range(N):
        if S[i][j] != ".":
            continue
        tmp = S[i][j]
        S[i][j] = "A"
        ans += check(S)
        S[i][j] = tmp
print(ans)
0