結果

問題 No.2692 How Many Times Reached?
ユーザー nwonwo
提出日時 2024-03-28 12:53:52
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 796 bytes
コンパイル時間 5,063 ms
コンパイル使用メモリ 315,064 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-09-30 14:43:28
合計ジャッジ時間 6,008 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ld = long double;
using ll = long long;

template<class T> bool chmax(T &a, T b)
{
	if(a<b)
	{
	a = b;
	return true;
	}
	return false;
}
template<class T> bool chmin(T &a, T b)
{
	if(a>b)
	{
		a = b;
		return true;
	}
	return false;
}
int N;
string S[100];
int main()
{
	cin >> N;
	rep(i,N) cin >> S[i];

	int ans = 0;
	rep(i,N)
	{
		map<char,int> mp;
		rep(j,N) mp[S[i][j]]++;
		if(mp['A']==N-1) ans++;
	}
	rep(j,N)
	{
		map<char,int> mp;
		rep(i,N) mp[S[i][j]]++;
		if(mp['A']==N-1) ans++;
	}
	map<char,int> mp;
	rep(i,N) mp[S[i][i]]++;
	if(mp['A']==N-1) ans++;
	mp.clear();
	rep(i,N) mp[S[i][i]]++;
	if(mp['A']==N-1) ans++;
	cout << ans << endl;
}
0