結果

問題 No.536 人工知能
コンテスト
ユーザー mk
提出日時 2022-01-09 07:18:53
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 1,000 ms
+ 898µs
コード長 686 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 491 ms
コンパイル使用メモリ 188,652 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2026-09-22 07:47:02
合計ジャッジ時間 1,598 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#[macro_export]
macro_rules! setup {
    { mut $input:ident: SplitWhitespace $(,)? } => {
        use std::io::Read;
        let mut buf = String::new();
        std::io::stdin().read_to_string(&mut buf).unwrap();
        let mut $input = buf.split_whitespace();
    };
}

#[macro_export]
macro_rules! parse_next {
    ($str_iter:expr) => {
        $str_iter.next().unwrap().parse().unwrap()
    };
}

fn main() {
    setup! { mut input: SplitWhitespace };
    let s: String = parse_next!(input);

    let (first, last) = s.split_at(s.len() - 2);

    let ai_name = if last == "ai" {
        first.to_owned() + "AI"
    } else {
        s + "-AI"
    };

    println!("{}", ai_name);
}
0