結果
問題 |
No.2692 How Many Times Reached?
|
ユーザー |
|
提出日時 | 2024-03-28 13:36:22 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 804 bytes |
コンパイル時間 | 4,551 ms |
コンパイル使用メモリ | 315,552 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-09-30 14:43:41 |
合計ジャッジ時間 | 5,643 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 29 WA * 14 |
ソースコード
#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[N-1-i][N-1-i]]++; if(mp['A']==N-1) ans++; cout << ans << endl; }