結果
| 問題 |
No.3125 Make It Symmetry
|
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2025-04-25 21:35:36 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 924 bytes |
| コンパイル時間 | 5,799 ms |
| コンパイル使用メモリ | 333,868 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-04-25 21:36:03 |
| 合計ジャッジ時間 | 7,024 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
int main()
{
int64_t n;
cin >> n;
vector<string> ss(n);
for (auto &&s : ss)
{
cin >> s;
}
int64_t cnt = 0;
for (auto &&s : ss)
{
for (auto &&c : s)
{
if (c == '#')
{
cnt++;
}
}
}
if (n % 2 == 0)
{
cout << (((cnt % 2 == 0) && ((n * n - cnt) % 2 == 0)) ? "Yes" : "No") << endl;
}
else
{
for (int64_t k = 0; k <= n; k++)
{
if (0 <= cnt - k && (cnt - k) % 2 == 0 && 0 <= n * n - n - (cnt - k) && (n * n - n - (cnt - k)) % 2 == 0)
{
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
return 0;
}
ldsyb