結果
問題 | No.2692 How Many Times Reached? |
ユーザー | mymelochan |
提出日時 | 2024-03-22 21:27:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 60 ms / 2,000 ms |
コード長 | 1,239 bytes |
コンパイル時間 | 394 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 65,536 KB |
最終ジャッジ日時 | 2024-09-30 10:49:45 |
合計ジャッジ時間 | 3,711 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
54,400 KB |
testcase_01 | AC | 41 ms
54,656 KB |
testcase_02 | AC | 40 ms
54,656 KB |
testcase_03 | AC | 41 ms
54,400 KB |
testcase_04 | AC | 42 ms
54,272 KB |
testcase_05 | AC | 42 ms
54,400 KB |
testcase_06 | AC | 42 ms
54,528 KB |
testcase_07 | AC | 40 ms
54,272 KB |
testcase_08 | AC | 42 ms
54,272 KB |
testcase_09 | AC | 43 ms
54,528 KB |
testcase_10 | AC | 41 ms
54,528 KB |
testcase_11 | AC | 42 ms
54,784 KB |
testcase_12 | AC | 42 ms
54,400 KB |
testcase_13 | AC | 43 ms
54,272 KB |
testcase_14 | AC | 43 ms
54,528 KB |
testcase_15 | AC | 43 ms
54,784 KB |
testcase_16 | AC | 42 ms
54,528 KB |
testcase_17 | AC | 41 ms
54,272 KB |
testcase_18 | AC | 41 ms
54,528 KB |
testcase_19 | AC | 41 ms
54,400 KB |
testcase_20 | AC | 41 ms
54,784 KB |
testcase_21 | AC | 42 ms
54,144 KB |
testcase_22 | AC | 41 ms
54,528 KB |
testcase_23 | AC | 41 ms
54,528 KB |
testcase_24 | AC | 41 ms
54,272 KB |
testcase_25 | AC | 42 ms
54,400 KB |
testcase_26 | AC | 41 ms
54,400 KB |
testcase_27 | AC | 42 ms
54,528 KB |
testcase_28 | AC | 44 ms
54,656 KB |
testcase_29 | AC | 45 ms
54,400 KB |
testcase_30 | AC | 44 ms
54,272 KB |
testcase_31 | AC | 41 ms
54,528 KB |
testcase_32 | AC | 45 ms
53,888 KB |
testcase_33 | AC | 42 ms
53,888 KB |
testcase_34 | AC | 54 ms
65,280 KB |
testcase_35 | AC | 53 ms
64,640 KB |
testcase_36 | AC | 52 ms
64,512 KB |
testcase_37 | AC | 51 ms
64,000 KB |
testcase_38 | AC | 53 ms
64,256 KB |
testcase_39 | AC | 60 ms
65,280 KB |
testcase_40 | AC | 54 ms
64,512 KB |
testcase_41 | AC | 50 ms
62,336 KB |
testcase_42 | AC | 56 ms
64,768 KB |
testcase_43 | AC | 57 ms
65,536 KB |
testcase_44 | AC | 50 ms
61,440 KB |
testcase_45 | AC | 43 ms
54,144 KB |
testcase_46 | AC | 56 ms
64,256 KB |
ソースコード
############################################################# import sys sys.setrecursionlimit(10**7) from heapq import heappop,heappush from collections import deque,defaultdict,Counter from bisect import bisect_left, bisect_right from itertools import product,combinations,permutations ipt = sys.stdin.readline def iin(): return int(ipt()) def lmin(): return list(map(int,ipt().split())) MOD = 998244353 ############################################################# N = iin() S = [input() for _ in range(N)] ans = 0 for i in range(N): cnt = 0 b = 0 for j in range(N): if S[i][j] == "A": cnt += 1 if S[i][j] == "B": b = 1 if cnt == N-1 and not b: ans += 1 cnt = 0 b = 0 for j in range(N): if S[j][i] == "A": cnt += 1 if S[j][i] == "B": b = 1 if cnt == N-1 and not b: ans += 1 cnt = 0 for i in range(N): if S[i][i] == "A": cnt += 1 if S[i][i] == "B": break else: if cnt == N-1: ans += 1 cnt = 0 for i in range(N): if S[i][N-i-1] == "A": cnt += 1 if S[i][N-i-1] == "B": break else: if cnt == N-1: ans += 1 print(ans)