結果

問題 No.3125 Make It Symmetry
ユーザー shimaaa
提出日時 2025-04-25 21:41:36
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 664 bytes
コンパイル時間 3,172 ms
コンパイル使用メモリ 275,900 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-25 21:41:49
合計ジャッジ時間 4,532 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using LI = long long int;
using LD = long double;
using namespace std;
template <typename T>
using APQUE = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using DPQUE = priority_queue<T>;

int main() {
    int n;
    cin >> n;
    if (n % 2 == 1) {
        cout << "Yes" << endl;
        return 0;
    }
    vector<string> grid(n);
    rep(i, n) cin >> grid[i];
    int cnt = 0;
    for (auto &row : grid) {
        cnt += count(row.begin(), row.end(), '#');
    }
    if (cnt % 2 == 1) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
}
0