結果

問題 No.2692 How Many Times Reached?
ユーザー forest3
提出日時 2024-07-16 17:35:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 1,538 ms
コンパイル使用メモリ 169,984 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-16 17:35:20
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 40 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)

int main() {
	int N;
	cin >> N;
	vector<string> s(N);
	rep(i, N) cin >> s[i];
	int ans = 0;
	rep(i, N) {
		int c = 0;
		rep(j, N) if(s[i][j] == 'A') c++;
		if(c == N - 1) ans++;
	}
	rep(j, N) {
		int c = 0;
		rep(i, N) if(s[i][j] == 'A') c++;
		if(c == N - 1) ans++;
	}
	int c = 0;
	rep(i, N) if(s[i][i] == 'A') c++;
	if(c == N - 1) ans++;
	c = 0;
	rep(i, N) if(s[N - 1 - i][i] == 'A') c++;
	if(c == N - 1) ans++;
	cout << ans << endl;
}


0