結果

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

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;

typedef long long ll;

void solve() {
    int n;
    cin >> n;
    int sm = 0;
    rep(i, 0, n) rep(j, 0, n) {
        char c;
        cin >> c;
        sm += (c == '#');
    }
    bool ok = 0;
    ok |= n % 2;
    ok |= sm % 2 == 0;
    cout << (ok ? "Yes" : "No") << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    while (t--) {
        solve();
    }
}
0