結果

問題 No.2692 How Many Times Reached?
ユーザー well-defined
提出日時 2024-09-17 08:57:05
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 13,249 ms
コンパイル使用メモリ 401,760 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-17 08:57:21
合計ジャッジ時間 15,305 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;
use proconio::marker::Chars;

fn main () {
    input! {
        n: usize,
        b: [Chars;n],
    }
    //println!("{:?}",b);
    let mut ans = 0;
    ans += b.iter()
        .filter(|row| {
            row.iter()
                .filter(|&&c| c == 'A')
                .count() == n-1
        })
        .count();


    ans += (0..b[0].len())
        .filter(|&col| {
            b.iter()
                .filter(|row| row[col] == 'A')
                .count() == n-1
        })
        .count();
    println!("{}", ans);
        
}
0