結果
問題 |
No.2692 How Many Times Reached?
|
ユーザー |
![]() |
提出日時 | 2024-03-23 01:17:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 517 bytes |
コンパイル時間 | 484 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-30 12:55:51 |
合計ジャッジ時間 | 2,713 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
n = int(input()) g = [input() for _ in range(n)] ans = 0 for i in range(n): if g[i].count("A") == n - 1 and "B" not in g[i]: ans += 1 for j in range(n): t = [] for i in range(n): t.append(g[i][j]) if t.count("A") == n - 1 and "B" not in t: ans += 1 t = [] for i in range(n): t.append(g[i][i]) if t.count("A") == n - 1 and "B" not in t: ans += 1 t = [] for i in range(n): t.append(g[i][n - i - 1]) if t.count("A") == n - 1 and "B" not in t: ans += 1 print(ans)