結果

問題 No.197 手品
ユーザー phsplsphspls
提出日時 2020-05-21 00:01:46
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 800 bytes
コンパイル時間 498 ms
コンパイル使用メモリ 163,216 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-09 23:10:00
合計ジャッジ時間 1,676 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 0 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 0 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 AC 1 ms
6,944 KB
testcase_17 AC 1 ms
6,944 KB
testcase_18 AC 1 ms
6,944 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 1 ms
6,944 KB
testcase_21 AC 0 ms
6,940 KB
testcase_22 AC 1 ms
6,944 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1 ms
6,944 KB
testcase_27 AC 1 ms
6,940 KB
testcase_28 WA -
testcase_29 AC 1 ms
6,944 KB
testcase_30 AC 1 ms
6,944 KB
testcase_31 AC 1 ms
6,944 KB
testcase_32 WA -
testcase_33 AC 1 ms
6,944 KB
testcase_34 AC 1 ms
6,940 KB
testcase_35 AC 0 ms
6,940 KB
testcase_36 AC 0 ms
6,940 KB
testcase_37 AC 0 ms
6,940 KB
testcase_38 WA -
testcase_39 AC 1 ms
6,940 KB
testcase_40 AC 1 ms
6,944 KB
testcase_41 AC 0 ms
6,940 KB
testcase_42 AC 1 ms
6,940 KB
testcase_43 AC 0 ms
6,944 KB
testcase_44 AC 1 ms
6,940 KB
testcase_45 AC 0 ms
6,944 KB
testcase_46 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn xcount(s: &Vec<char>) -> usize {
    s.iter().filter(|c| **c == 'x').count()
}

fn main() {
    let mut s1 = String::new();
    std::io::stdin().read_line(&mut s1).ok();
    let s1: Vec<char> = s1.trim().chars().collect();
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let n: usize = n.trim().parse().unwrap();
    let mut s2 = String::new();
    std::io::stdin().read_line(&mut s2).ok();
    let s2: Vec<char> = s2.trim().chars().collect();

    if xcount(&s1) != xcount(&s2) {
        println!("SUCCESS");
    } else if n == 1 {
        if (xcount(&s1) == 1 || xcount(&s1) == 2) && (s1[0] == s2[2] || s1[2] == s2[0]) {
            println!("SUCCESS");
        } else {
            println!("FAILURE");
        }
    } else {
        println!("FAILURE");
    }
}
0