結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N; cin >> N;
    int akane = 0,aoi = 0;
    for(int i=0; i<N; i++){
        string s; cin >> s;
        for(auto c : s) akane += c=='#',aoi += c=='.';
    }
    for(int i=0; i<N; i++) for(int k=0; k<N/2; k++){
        if(akane >= 2) akane -= 2;
        else if(aoi >= 2) aoi -= 2;
    }
    if(N%2 == 0 && akane+aoi) cout << "No\n";
    else cout << "Yes\n";
}  
0