結果

問題 No.2864 String of yuusaan
ユーザー naut3
提出日時 2024-11-11 00:44:47
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 865 bytes
コンパイル時間 12,313 ms
コンパイル使用メモリ 378,800 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-11 00:45:00
合計ジャッジ時間 12,998 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `N`
  --> src/main.rs:23:9
   |
23 |     let N = input!(usize);
   |         ^ help: if this is intentional, prefix it with an underscore: `_N`
   |
   = note: `#[warn(unused_variables)]` on by default

ソースコード

diff #

#![allow(non_snake_case, unused_must_use, unused_imports)]
use std::io::{self, prelude::*};

fn main() {
    let (stdin, stdout) = (io::read_to_string(io::stdin()).unwrap(), io::stdout());
    let (mut stdin, mut buffer) = (stdin.split_whitespace(), io::BufWriter::new(stdout.lock()));

    macro_rules! input {
        ($t: tt, $n: expr) => {
            (0..$n).map(|_| input!($t)).collect::<Vec<_>>()
        };
        (Chars) => {
            input! {String}.chars().collect::<Vec<_>>()
        };
        (Usize1) => {
            stdin.next().unwrap().parse::<usize>().unwrap() - 1
        };
        ($t: ty) => {
            stdin.next().unwrap().parse::<$t>().unwrap()
        };
    }

    let N = input!(usize);
    let K = input!(Usize1);

    let k = K % 12;
    let a = "yuusaanuusaa".chars().collect::<Vec<_>>()[k];
    writeln!(buffer, "{}", a);
}
0