結果

問題 No.3125 Make It Symmetry
ユーザー InTheBloom
提出日時 2025-04-25 21:24:55
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 682 bytes
コンパイル時間 5,536 ms
コンパイル使用メモリ 160,736 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-25 21:25:19
合計ジャッジ時間 3,405 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main () {
    int N = readln.chomp.to!int;
    auto A = new string[](N);
    foreach (i; 0 .. N) {
        A[i] = readln.chomp;
    }

    int b = 0;
    foreach (i; 0 .. N) {
        foreach (j; 0 .. N) {
            if (A[i][j] == '#') {
                b++;
            }
        }
    }

    bool ok = true;
    if (N % 2 == 0 && b % 2 == 1) {
        ok = false;
    }

    if (ok) {
        writeln("Yes");
    }
    else {
        writeln("No");
    }
}

void read (T...) (string S, ref T args) {
    import std.conv : to;
    import std.array : split;
    auto buf = S.split;
    foreach (i, ref arg; args) {
        arg = buf[i].to!(typeof(arg));
    }
}
0