結果
| 問題 | No.2692 How Many Times Reached? |
| コンテスト | |
| ユーザー |
srjywrdnprkt
|
| 提出日時 | 2024-03-22 21:29:06 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 855µs | |
| コード長 | 1,067 bytes |
| 記録 | |
| コンパイル時間 | 1,355 ms |
| コンパイル使用メモリ | 218,524 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-20 20:09:48 |
| 合計ジャッジ時間 | 3,537 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 44 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int N, ans=0, c=0, d=0;
cin >> N;
vector<string> s(N);
for (int i=0; i<N; i++) cin >> s[i];
for (int i=0; i<N; i++){
c = 0;
d = 0;
for (int j=0; j<N; j++){
if (s[i][j] == 'A') c++;
if (s[i][j] == '.') d++;
}
if (c == N-1 && d == 1) ans++;
}
for (int i=0; i<N; i++){
c = 0;
d = 0;
for (int j=0; j<N; j++){
if (s[j][i] == 'A') c++;
if (s[j][i] == '.') d++;
}
if (c == N-1 && d == 1) ans++;
}
c = 0;
d = 0;
for (int i=0; i<N; i++){
if (s[i][i] == 'A') c++;
if (s[i][i] == '.') d++;
}
if (c == N-1 && d == 1) ans++;
c = 0;
d = 0;
for (int i=0; i<N; i++){
if (s[i][N-1-i] == 'A') c++;
if (s[i][N-1-i] == '.') d++;
}
if (c == N-1 && d == 1) ans++;
cout << ans << endl;
return 0;
}
srjywrdnprkt