結果
問題 | No.2692 How Many Times Reached? |
ユーザー |
|
提出日時 | 2024-03-22 21:23:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 582 bytes |
コンパイル時間 | 180 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 60,288 KB |
最終ジャッジ日時 | 2024-09-30 10:46:19 |
合計ジャッジ時間 | 3,180 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
N = int(input())S = [input() for _ in range(N)]ans = 0for i in range(N):if S[i].count('A') == N - 1 and S[i].count('.') == 1:ans += 1for i in range(N):ca = 0cd = 0for j in range(N):if S[j][i] == 'A':ca += 1if S[j][i] == '.':cd += 1if ca == N - 1 and cd == 1:ans += 1ca1 = 0cd1 = 0ca2 = 0cd2 = 0for i in range(N):if S[i][i] == 'A':ca1 += 1if S[i][i] == '.':cd1 += 1if S[i][N - 1 - i] == 'A':ca2 += 1if S[i][N - 1 - i] == '.':cd2 += 1if ca1 == N - 1 and cd1 == 1:ans += 1if ca2 == N - 1 and cd2 == 1:ans += 1print(ans)