結果
| 問題 |
No.2692 How Many Times Reached?
|
| コンテスト | |
| ユーザー |
ゆにぽけ
|
| 提出日時 | 2024-03-22 21:31:56 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,646 bytes |
| コンパイル時間 | 1,222 ms |
| コンパイル使用メモリ | 124,888 KB |
| 最終ジャッジ日時 | 2025-02-20 11:15:08 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 43 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <iterator>
#include <string>
#include <cctype>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cmath>
#include <ctime>
#include <iomanip>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <random>
#include <utility>
#include <functional>
using namespace std;
void Main()
{
int N;
cin >> N;
vector<string> S(N);
for(int i = 0;i < N;i++)
{
cin >> S[i];
}
int ans = 0;
for(int i = 0;i < N;i++)
{
for(int j = 0;j < N;j++)
{
if(S[i][j] == '.')
{
{
bool ok = true;
for(int k = 0;k < N;k++)
{
if(k != j && S[i][k] != 'A')
{
ok = false;
break;
}
}
if(ok)
{
ans++;
}
}
{
bool ok = true;
for(int k = 0;k < N;k++)
{
if(k != i && S[k][j] != 'A')
{
ok = false;
break;
}
}
if(ok)
{
ans++;
}
}
if(i == j)
{
bool ok = true;
for(int k = 0;k < N;k++)
{
if(k != i && S[k][k] != 'A')
{
ok = false;
}
}
if(ok)
{
ans++;
}
}
if(i + j == N - 1)
{
bool ok = true;
for(int k = 0;k < N;k++)
{
if(k != i && S[k][N - k - 1] != 'A')
{
ok = false;
}
}
if(ok)
{
ans++;
}
}
}
}
}
cout << ans << "\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tt = 1;
/* cin >> tt; */
while(tt--) Main();
}
ゆにぽけ