結果

問題 No.2692 How Many Times Reached?
ユーザー soldraysoldray
提出日時 2024-03-26 21:39:16
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,042 bytes
コンパイル時間 2,290 ms
コンパイル使用メモリ 159,824 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-26 21:39:22
合計ジャッジ時間 4,899 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

#define yn(pope) (pope ? "Yes" : "No")

#define rep(i, n, m) for (int i = (n); i < (m); i++)
#define rrep(i, n, m) for (int i = (n); i > m; i--)

#define IINF (1 << 30)
#define INF (1ll << 60)

#define all(v) v.begin(), v.end()

int main() {
  int N;
  cin >> N;

  vector M(N, vector(N, '.'));

  rep(i, 0, N) {
    rep(j, 0, N) { cin >> M[j][i]; }
  }

  auto hori = [&]() -> int {
    int count = 0;

    rep(i, 0, N) {
      int c = 0;

      rep(j, 0, N) {
        if (M[j][i] == 'A') { c++; }
      }

      count += (c == N);
    }

    return count;
  };

  auto vert = [&]() -> int {
    int count = 0;

    rep(j, 0, N) {
      int c = 0;

      rep(i, 0, N) {
        if (M[j][i] == 'A') { c++; }
      }

      count += (c == N);
    }

    return count;
  };

  int ans = 0;

  rep(i, 0, N) {
    rep(j, 0, N) {
      char t = M[j][i];
      M[j][i] = 'A';
      ans += (hori() + vert());
      M[j][i] = t;
    }
  }

  cout << ans << endl;

  return 0;
}
0