結果

問題 No.2692 How Many Times Reached?
ユーザー RikuohRikuoh
提出日時 2024-03-22 22:38:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,298 bytes
コンパイル時間 4,188 ms
コンパイル使用メモリ 232,076 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-22 22:38:54
合計ジャッジ時間 5,668 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 3 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 WA -
testcase_09 AC 3 ms
6,676 KB
testcase_10 WA -
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 WA -
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 3 ms
6,676 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
6,676 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 2 ms
6,676 KB
testcase_35 AC 2 ms
6,676 KB
testcase_36 AC 2 ms
6,676 KB
testcase_37 AC 2 ms
6,676 KB
testcase_38 AC 2 ms
6,676 KB
testcase_39 AC 2 ms
6,676 KB
testcase_40 AC 2 ms
6,676 KB
testcase_41 AC 2 ms
6,676 KB
testcase_42 AC 2 ms
6,676 KB
testcase_43 AC 3 ms
6,676 KB
testcase_44 AC 2 ms
6,676 KB
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
const int inf = INT_MAX / 2;
const ll infl = 1LL << 60;
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define rrep(i,a,b) for(int i = a; i >= b; --i)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
const int MOD = 998244353;


int main(){
  int n;
  cin >> n;
  vector<string> s(n);
  rep(i,0,n)cin >> s[i];
  int ans = 0;
  
  rep(i,0,n){
    if(count(all(s[i]),'A') == n-1 && count(all(s[i]),'.') == 1) ans++;
  }
    
  vector<string> t(n);
  rep(i,0,n){
    rep(j,0,n){
      t[i].push_back(s[j][i]);
    }
  }
  
  rep(i,0,n){
    if(count(all(t[i]),'A') == n-1 && count(all(t[i]),'.') == 1) ans++;
  }

  string u;
  rep(i,0,n){
    rep(j,i,n){
      u.push_back(s[i][j]);
      break;
    }
  }

  rep(i,0,n){
    if(count(all(u),'A') == n-1 && count(all(u),'.') == 1) ans++;
  }

  string v;
  rrep(i,n-1,0){
    rrep(j,i,0){
      v.push_back(s[i][j]);
      break;
    }
  }

  rep(i,0,n){
    if(count(all(v),'A') == n-1 && count(all(v),'.') == 1) ans++;
  }

  cout << ans << endl;


  return 0;
}
0