結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-21 00:00:48 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 780 bytes |
| コンパイル時間 | 13,668 ms |
| コンパイル使用メモリ | 382,732 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-01 23:47:39 |
| 合計ジャッジ時間 | 15,323 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 40 WA * 3 |
ソースコード
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] {
println!("SUCCESS");
} else {
println!("FAILURE");
}
} else {
println!("FAILURE");
}
}