結果
| 問題 |
No.2692 How Many Times Reached?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-22 21:24:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 793 bytes |
| コンパイル時間 | 763 ms |
| コンパイル使用メモリ | 65,408 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-09-30 10:46:33 |
| 合計ジャッジ時間 | 1,916 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 43 |
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
int N;
string S[100];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>N;
for(int i=0;i<N;i++)cin>>S[i];
int ans=0;
for(int i=0;i<N;i++)
{
{
int cnt=0;
for(int j=0;j<N;j++)
{
if(S[i][j]=='A')cnt++;
else if(S[i][j]=='B')cnt=-1e9;
}
if(cnt==N-1)ans++;
}
{
int cnt=0;
for(int j=0;j<N;j++)
{
if(S[j][i]=='A')cnt++;
else if(S[j][i]=='B')cnt=-1e9;
}
if(cnt==N-1)ans++;
}
}
{
int cnt=0;
for(int j=0;j<N;j++)
{
if(S[j][j]=='A')cnt++;
else if(S[j][j]=='B')cnt=-1e9;
}
if(cnt==N-1)ans++;
}
{
int cnt=0;
for(int j=0;j<N;j++)
{
if(S[N-1-j][j]=='A')cnt++;
else if(S[N-1-j][j]=='B')cnt=-1e9;
}
if(cnt==N-1)ans++;
}
cout<<ans<<endl;
}