結果

問題 No.201 yukicoderじゃんけん
コンテスト
ユーザー neko_the_shadow
提出日時 2024-02-07 13:35:37
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 5,000 ms
+ 951µs
コード長 745 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,681 ms
コンパイル使用メモリ 185,028 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-05 16:07:29
合計ジャッジ時間 2,445 ms
ジャッジサーバーID
(参考情報)
judge5_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::stdin;

fn main() {
    let (sa, pa, _xa) = readline();
    let (sb, pb, _xb) = readline();

    if pa.len() == pb.len() {
        if pa > pb {
            println!("{}", sa);
        } else if pa < pb {
            println!("{}", sb);
        } else {
            println!("{}", -1);
        }
    } else if pa.len() > pb.len() {
        println!("{}", sa);
    } else {
        println!("{}", sb);
    }
}

fn readline() -> (String, String, String) {
    let mut line = String::new();
    stdin().read_line(&mut line).ok();
    let mut tokens = line.split_whitespace();
    let a = tokens.next().unwrap().to_string();
    let b = tokens.next().unwrap().to_string();
    let c = tokens.next().unwrap().to_string();
    (a, b, c)
}
0