結果

問題 No.138 化石のバージョン
コンテスト
ユーザー Haniwa
提出日時 2025-11-30 19:47:34
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 558 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 10,595 ms
コンパイル使用メモリ 404,584 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2025-11-30 19:47:48
合計ジャッジ時間 12,388 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::input;
use std::cmp::Ordering::{Equal, Greater, Less};

fn main() {
	input! {
		s: String,
		t: String,
	}

    let mut a = s.chars().filter_map(|c| c.to_digit(10));
    let mut b = t.chars().filter_map(|c| c.to_digit(10));

    for (x, y) in a.by_ref().zip(b.by_ref()) {
        match x.cmp(&y) {
            Equal => continue,
            Greater => {
            	println!("YES");
            	return;
            },
            Less => {
	            println!("NO");
	            return;
	        },
        }
    }

    println!("YES");
}
0